ea2660a6a9eef5d2f35f0c65bb41b95690fb4e1a.svn-base
2.24 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
var testCase = require('nodeunit').testCase;
/*
This is an example test suite to demonstrate the nested test reporter.
Run with --reporter nested, e.g.,
nodeunit --reporter nested nested_reporter_test.unit.js
The test output should be something like:
nested_reporter_test.unit.js
Test 0.1 (pass)
TC 1
TC 1.1
Test 1.1.1 (pass)
TC 2
TC 2.1
TC 2.1.1
Test 2.1.1.1 (pass)
Test 2.1.1.2 (pass)
TC 2.2.1
Test 2.2.1.1 (pass)
TC 2.2.1.1
Test 2.2.1.1.1 (pass)
Test 2.2.1.2 (pass)
TC 3
TC 3.1
TC 3.1.1
Test 3.1.1.1 (should fail) (fail) ✖
AssertionError: false == true
// stack trace here.
FAILURES: 1/8 assertions failed (6ms)
*/
module.exports = testCase({
"Test 0.1": function(test) {
test.ok(true);
test.done();
},
"TC 1": testCase({
"TC 1.1": testCase({
"Test 1.1.1": function(test) {
test.ok(true);
test.done();
}
})
}),
"TC 2": testCase({
"TC 2.1": testCase({
"TC 2.1.1": testCase({
"Test 2.1.1.1": function(test) {
test.ok(true);
test.done();
},
"Test 2.1.1.2": function(test) {
test.ok(true);
test.done();
}
}),
"TC 2.2.1": testCase({
"Test 2.2.1.1": function(test) {
test.ok(true);
test.done();
},
"TC 2.2.1.1": testCase({
"Test 2.2.1.1.1": function(test) {
test.ok(true);
test.done();
},
}),
"Test 2.2.1.2": function(test) {
test.ok(true);
test.done();
}
})
})
}),
"TC 3": testCase({
"TC 3.1": testCase({
"TC 3.1.1": testCase({
"Test 3.1.1.1 (should fail)": function(test) {
test.ok(false);
test.done();
}
})
})
})
});