FCF 2.0 development in progress...
> > > > > >
[News] [Packages API] [Downloads] [Donate to the project] [Contacts]

greater() method from fcf.NUnitest.Unitest class

greater(mixed a_left, mixed a_right)

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 greater than throws a test error.

Arguments

mixed a_left
- First comparison value

mixed a_right
- 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.greater(1, 2); }); unitest.run() .finally(()=>{ process.exit(0); });

Output:

2023-05-10 18:47:12.716 [PID:166598] [LOG] [MOD:UniTest]: ==================================================== 2023-05-10 18:47:12.723 [PID:166598] [LOG] [MOD:UniTest]: Start testing on the server side... 2023-05-10 18:47:12.723 [PID:166598] [LOG] [MOD:UniTest]: Parts: * 2023-05-10 18:47:12.724 [PID:166598] [LOG] [MOD:UniTest]: Groups: * 2023-05-10 18:47:12.724 [PID:166598] [LOG] [MOD:UniTest]: Tests: * 2023-05-10 18:47:12.725 [PID:166598] [LOG] [MOD:UniTest]: 2023-05-10 18:47:12.725 [PID:166598] [LOG] [MOD:UniTest]: Start local tests... 2023-05-10 18:47:12.726 [PID:166598] [LOG] [MOD:UniTest]: -------------------- 2023-05-10 18:47:12.726 [PID:166598] [LOG] [MOD:UniTest]: Test [default][default][Some test] running ... 2023-05-10 18:47:12.732 [PID:166598] [LOG] [MOD:UniTest]: Test [default][default][Some test] is failed. Position: /home/user/project/index.js:5 Error: "1" is not greater than "2" Stack: Namespace.Unitest.compare (/home/user/project/node_modules/fcf-framework-unitest/unitest.js:217:19) Namespace.Unitest.greater (/home/user/project/node_modules/fcf-framework-unitest/unitest.js:286:21) Object.test (/home/user/project/index.js:5:13) Actions. (/home/user/project/node_modules/fcf-framework-unitest/unitest.js:612:26) Actions._execute (/home/user/project/node_modules/fcf-framework-core/fcf.js:3149:24) Actions.then (/home/user/project/node_modules/fcf-framework-core/fcf.js:2595:16) Namespace.Unitest._runLocalTests (/home/user/project/node_modules/fcf-framework-unitest/unitest.js:608:14) Actions. (/home/user/project/node_modules/fcf-framework-unitest/unitest.js:529:25) Actions._execute (/home/user/project/node_modules/fcf-framework-core/fcf.js:3154:24) Object.complete (/home/user/project/node_modules/fcf-framework-core/fcf.js:3113:18) 2023-05-10 18:47:12.733 [PID:166598] [LOG] [MOD:UniTest]: 2023-05-10 18:47:12.733 [PID:166598] [LOG] [MOD:UniTest]: ---------------------------------------------------- 2023-05-10 18:47:12.733 [PID:166598] [LOG] [MOD:UniTest]: 1 test have been completed. 2023-05-10 18:47:12.734 [PID:166598] [LOG] [MOD:UniTest]: Errors: 1; Successfully: 0; Total: 1 2023-05-10 18:47:12.734 [PID:166598] [LOG] [MOD:UniTest]: Tests that failed: Executor server: [default][default][Some test]