@@ -13,6 +13,47 @@ var runnerPath = path.resolve(path.join(__dirname, '..', 'bin', 'cli.js'));
13
13
var testHome = path . resolve ( __dirname ) ;
14
14
process . chdir ( testHome ) ;
15
15
16
+ /**
17
+ * Mocha v2.4.5 - to change with another Mocha version or
18
+ * something with Mocha tests
19
+ *
20
+ * index.html - 22 tests, 18 passed, 4 failed -> one test is displayed twice,
21
+ * so they are displayed 5 failing tests, but counted only 4
22
+ * large.html - 64 tests, 60 passed, 4 failed -> only 2 tests are failing, but
23
+ * they are displayed twice
24
+ * opts.html - 8 tests, 2 passed, 6 failed -> only 3 tests are failing, but
25
+ * they are displayed twice
26
+ *
27
+ * By "displayed" it is referred the Mocha HTML Reporter.
28
+ *
29
+ * From the above explanations it is clear that there are some inconsistencies,
30
+ * also because Mocha's HTML Reporter counted number of tests does not match
31
+ * the number of displyed tests.
32
+ *
33
+ * The cause is (snippet from Mocha's HTML reporter):
34
+ *
35
+ * runner.on('fail', function(test) {
36
+ * // For type = 'test' its possible that the test failed due to multiple
37
+ * // done() calls. So report the issue here.
38
+ * if (test.type === 'hook'
39
+ * || test.type === 'test') {
40
+ * runner.emit('test end', test);
41
+ * }
42
+ * });
43
+ *
44
+ * This is why failed tests are displayed twice...
45
+ *
46
+ * The JsReporters is counting the tests on the "test end" event, that's why
47
+ * it is capturing the failing tests twice, in the "index.html" it does not
48
+ * capture everything, because there is an async test, which failure is
49
+ * triggered after a timeout and the JsReporters is not waiting, because
50
+ * it cannot know how much to wait.
51
+ *
52
+ *
53
+ * This been said, the JsReporter MochaAdapter is functioning well, this
54
+ * version of Mocha is not reliable and should be changed.
55
+ */
56
+
16
57
var repositories = [
17
58
{
18
59
name : 'qunit' ,
@@ -36,7 +77,7 @@ var repositories = [
36
77
failed : 0
37
78
}
38
79
} ,
39
- /* {
80
+ {
40
81
name : 'mocha' ,
41
82
tag : 'v2.4.5' ,
42
83
url : 'https://github.com/mochajs/mocha.git' ,
@@ -55,11 +96,11 @@ var repositories = [
55
96
'test/browser/opts.html'
56
97
] ,
57
98
expected_results : {
58
- tests: 89 ,
99
+ tests : 94 ,
59
100
passed : 80 ,
60
- failed: 9
101
+ failed : 14
61
102
}
62
- },*/
103
+ } ,
63
104
{
64
105
name : 'spine' ,
65
106
tag : 'v.1.6.2' ,
0 commit comments