/
test-sync_assertions.js
39 lines (33 loc) · 993 Bytes
/
test-sync_assertions.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
if (module == require.main) {
return require('../lib/async_testing').run(process.ARGV);
}
module.exports = {
'test success': function(test) {
test.ok(true, 'This should be true');
test.finish();
},
'test fail': function(test) {
test.ok(false, 'This should be false');
test.finish();
},
'test success -- numAssertionsExpected': function(test) {
test.numAssertions = 1;
test.ok(true, 'This should be true');
test.finish();
},
'test fail -- numAssertionsExpected': function(test) {
test.numAssertions = 1;
test.ok(false, 'fail -- numAssertions expected shouldn\'t overwrite failures');
test.finish();
},
'test fail - not enough -- numAssertionsExpected': function(test) {
test.numAssertions = 1;
test.finish();
},
'test fail - too many -- numAssertionsExpected': function(test) {
test.numAssertions = 1;
test.ok(true, 'This should be true');
test.ok(true, 'This should be true');
test.finish();
}
};