lessEqual() method from fcf.NUnitest.Unitest class
Package: fcf-framework-unitest
File: fcf-framework-unitest:unitest.js
Available from version: 1.0.1
Compares two values, and if the first value is not less or equal to the second than, throws a test error.
Arguments
- First comparison value
- Second compared value
Example: Function application
let fcf = require("fcf-framework-core");
let unitest = require("fcf-framework-unitest");
fcf.test("Some test", (a_unitest)=>{
a_unitest.lessEqual(2, 1);
});
unitest.run()
.finally(()=>{
process.exit(0);
});
Output:
2023-05-10 18:33:59.667 [PID:166228] [LOG] [MOD:UniTest]: ====================================================
2023-05-10 18:33:59.672 [PID:166228] [LOG] [MOD:UniTest]: Start testing on the server side...
2023-05-10 18:33:59.673 [PID:166228] [LOG] [MOD:UniTest]: Parts: *
2023-05-10 18:33:59.673 [PID:166228] [LOG] [MOD:UniTest]: Groups: *
2023-05-10 18:33:59.674 [PID:166228] [LOG] [MOD:UniTest]: Tests: *
2023-05-10 18:33:59.675 [PID:166228] [LOG] [MOD:UniTest]:
2023-05-10 18:33:59.675 [PID:166228] [LOG] [MOD:UniTest]: Start local tests...
2023-05-10 18:33:59.675 [PID:166228] [LOG] [MOD:UniTest]: --------------------
2023-05-10 18:33:59.676 [PID:166228] [LOG] [MOD:UniTest]: Test [default][default][Some test] running ...
2023-05-10 18:33:59.680 [PID:166228] [LOG] [MOD:UniTest]: Test [default][default][Some test] is failed.
Position: /home/phoenix/development/fcf2/examples_for_site/unitest/add.js:5
Error: "2" is not less than "1" or not equal
Stack:
Namespace.Unitest.compare (/home/phoenix/development/fcf2/fcf-framework-unitest/unitest.js:213:19)
Namespace.Unitest.lessEqual (/home/phoenix/development/fcf2/fcf-framework-unitest/unitest.js:275:21)
Object.test (/home/phoenix/development/fcf2/examples_for_site/unitest/add.js:5:13)
Actions. (/home/phoenix/development/fcf2/fcf-framework-unitest/unitest.js:612:26)
Actions._execute (/home/phoenix/node_modules/fcf-framework-core/fcf.js:3149:24)
Actions.then (/home/phoenix/node_modules/fcf-framework-core/fcf.js:2595:16)
Namespace.Unitest._runLocalTests (/home/phoenix/development/fcf2/fcf-framework-unitest/unitest.js:608:14)
Actions. (/home/phoenix/development/fcf2/fcf-framework-unitest/unitest.js:529:25)
Actions._execute (/home/phoenix/node_modules/fcf-framework-core/fcf.js:3154:24)
Object.complete (/home/phoenix/node_modules/fcf-framework-core/fcf.js:3113:18)
2023-05-10 18:33:59.681 [PID:166228] [LOG] [MOD:UniTest]:
2023-05-10 18:33:59.681 [PID:166228] [LOG] [MOD:UniTest]: ----------------------------------------------------
2023-05-10 18:33:59.682 [PID:166228] [LOG] [MOD:UniTest]: 1 test have been completed.
2023-05-10 18:33:59.682 [PID:166228] [LOG] [MOD:UniTest]: Errors: 1; Successfully: 0; Total: 1
2023-05-10 18:33:59.682 [PID:166228] [LOG] [MOD:UniTest]: Tests that failed:
Executor server: [default][default][Some test]