profess
.suite("weird integer testing") // add suite to describe your tests
.want(1).toBeEqual(1)
.want(42).toBeEqual(42)
.test() // close suit by running test() method
.suite("add more odd testing") // you can chain as much suits as you want
.want(true).toBeEqual(false)
.test()
profess.withCoverage();
// run your tests or suits here
profess.result();
profess.fast(value)(expectedValue)
profess.fast(100)(100);
result:
Fast checking:
100 equals 100
type = "number"
profess.fast(2)("2")
result:
Fast checking:
2 equals 2 but types are different: 2 is not of the type string as it should be
Note that you do not need suite() or anything else to perform fast checking
Keep in mind that fast tests are not recorded by withCoverage()
method
toBeEqual(value)
profess.want(1).toBeEqual(2).test(); // fail
toMatchTypes(value)
const test = "Some string";
profess.want("testing this").toMatchTypes(test).test(); // Pass
toBeInRange(min, max)
const value = 1337;
profess.want(value).toBeInRange(42, 9001).test(); // Pass
toExist()
let doesNotExist;
profess
.want(0).toExist() // Pass
.want(null).toExist() // Pass
.want('').toExist() // Pass
.want(doesNotExist).toExist() // Fail
.test();
Note that this is not a falsy test
absolute(value)
profess
.want(-0).toBeEqual(+0) // Pass
.want(-0).absolute(+0) // Fail
.test();
toBe.<Type>()
<Type>
— Function, String, Number, Boolean, Null, Undefined
profess
.want(1).toBe.Number() // Pass
.want("bob").toBe.String() // Pass
.want(null).toBe.Function() // Fail
.test();