-
Notifications
You must be signed in to change notification settings - Fork 0
/
opposite.test.js
40 lines (32 loc) · 1.34 KB
/
opposite.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/**
* ************************ CHAPTER 2 ************************************************
* Opposite Matcher
* ************************************************************************************
*
*
* @see https://jestjs.io/docs/en/api#testname-fn-timeout
* @author Abhijeet Bhagat
*
* NOTE :- if you need to run tests only in this test suite then use following command
* ****************************** COMMAND ********************************************
* ___________________________________________________________________________________|
* npm test -t opposite.test.js |
* ___________________________________________________________________________________|
*/
const math = require('./lib/basicmath.js');
/**
* To test for opposite of matcher use .not. before the matcher as below
*/
test('Opposite of matcher',()=>{
// Here we are testing if 5-4 is NOT equal to zero.
expect(math.subtract(5,4)).not.toBe(0);
});
/**
******************************** Quiz ***************************************************
* 1. how to expect opposite of matcher?
*/
/**
* next go to
* @see https://github.com/bhagatabhijeet/jestSamples/blob/master/truthiness.test.js
* @see truthiness.test.js
*/