new ResultChecker("testMethod")
// .expect(A boolean value to be true, what it is testing);
.expect(sucess, "Somthing to be true")
.expect(value == 2, "value == 2");
Real Example
new ResultChecker("testConnection")
.expect(database.isConnected(), "database.isConnected()");
Example
new ResultChecker("testMethod")
// You can also do it like this.
// It will check if the values are equal.
.expect(value, 2, "value == 2");
Send a message when any expect fails
new ResultChecker("testMethod")
// If a boolean fails it will send this first.
.fallBack("This test failed")
.expect(sucess, "Somthing to be true")
.expect(value == 2, "value == 2");
Do something after
new ResultChecker("testMethod")
.expect(sucess, "Somthing to be true")
.expect(value == 2, "value == 2")
.then(() => aMethod());
You can just write code after a result checker tho.