mocha 1.8.1 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.travis.yml +2 -3
- package/History.md +44 -1
- package/Makefile +5 -1
- package/Readme.md +108 -20
- package/_mocha.js +111 -82
- package/bin/_mocha +26 -19
- package/bin/mocha +6 -2
- package/component.json +1 -1
- package/lib/browser/debug.js +1 -2
- package/lib/browser/tty.js +7 -2
- package/lib/hook.js +0 -1
- package/lib/interfaces/bdd.js +3 -3
- package/lib/interfaces/exports.js +5 -5
- package/lib/interfaces/qunit.js +38 -9
- package/lib/interfaces/tdd.js +15 -2
- package/lib/mocha.js +1 -1
- package/lib/reporters/base.js +26 -34
- package/lib/reporters/html.js +0 -2
- package/lib/reporters/min.js +2 -2
- package/lib/reporters/nyan.js +33 -39
- package/lib/reporters/templates/coverage.jade +3 -3
- package/lib/reporters/xunit.js +2 -2
- package/lib/runnable.js +6 -8
- package/lib/runner.js +22 -11
- package/lib/template.html +2 -1
- package/lib/utils.js +1 -1
- package/mocha.css +28 -9
- package/mocha.js +184 -151
- package/package.json +4 -3
- package/test.js +6 -7
package/.travis.yml
CHANGED
package/History.md
CHANGED
|
@@ -1,5 +1,48 @@
|
|
|
1
1
|
|
|
2
|
-
1.
|
|
2
|
+
1.11.0 / 2013-06-12
|
|
3
|
+
==================
|
|
4
|
+
|
|
5
|
+
* add --prof support
|
|
6
|
+
* add --harmony support
|
|
7
|
+
* add --harmony-generators support
|
|
8
|
+
* add "Uncaught " prefix to uncaught exceptions
|
|
9
|
+
* add web workers support
|
|
10
|
+
* add `suite.skip()`
|
|
11
|
+
* change to output # of pending / passing even on failures. Closes #872
|
|
12
|
+
* fix: prevent hooks from being called if we are bailing
|
|
13
|
+
* fix `this.timeout(0)`
|
|
14
|
+
|
|
15
|
+
1.10.0 / 2013-05-21
|
|
16
|
+
==================
|
|
17
|
+
|
|
18
|
+
* add add better globbing support for windows via `glob` module
|
|
19
|
+
* add support to pass through flags such as --debug-brk=1234. Closes #852
|
|
20
|
+
* add test.only, test.skip to qunit interface
|
|
21
|
+
* change to always use word-based diffs for now. Closes #733
|
|
22
|
+
* change `mocha init` tests.html to index.html
|
|
23
|
+
* fix `process` global leak in the browser
|
|
24
|
+
* fix: use resolve() instead of join() for --require
|
|
25
|
+
* fix: filterLeaks() condition to not consider indices in global object as leaks
|
|
26
|
+
* fix: restrict mocha.css styling to #mocha id
|
|
27
|
+
* fix: save timer references to avoid Sinon interfering in the browser build.
|
|
28
|
+
|
|
29
|
+
1.9.0 / 2013-04-03
|
|
30
|
+
==================
|
|
31
|
+
|
|
32
|
+
* add improved setImmediate implementation
|
|
33
|
+
* replace --ignore-leaks with --check-leaks
|
|
34
|
+
* change default of ignoreLeaks to true. Closes #791
|
|
35
|
+
* remove scrolling for HTML reporter
|
|
36
|
+
* fix retina support
|
|
37
|
+
* fix tmbundle, restrict to js scope
|
|
38
|
+
|
|
39
|
+
1.8.2 / 2013-03-11
|
|
40
|
+
==================
|
|
41
|
+
|
|
42
|
+
* add `setImmediate` support for 0.10.x
|
|
43
|
+
* fix mocha -w spinner on windows
|
|
44
|
+
|
|
45
|
+
1.8.1 / 2013-01-09
|
|
3
46
|
==================
|
|
4
47
|
|
|
5
48
|
* fix .bail() arity check causing it to default to true
|
package/Makefile
CHANGED
|
@@ -33,7 +33,7 @@ lib-cov:
|
|
|
33
33
|
|
|
34
34
|
test: test-unit
|
|
35
35
|
|
|
36
|
-
test-all: test-bdd test-tdd test-qunit test-exports test-unit test-grep test-jsapi test-compilers
|
|
36
|
+
test-all: test-bdd test-tdd test-qunit test-exports test-unit test-grep test-jsapi test-compilers test-glob
|
|
37
37
|
|
|
38
38
|
test-jsapi:
|
|
39
39
|
@node test/jsapi
|
|
@@ -42,6 +42,7 @@ test-unit:
|
|
|
42
42
|
@./bin/mocha \
|
|
43
43
|
--reporter $(REPORTER) \
|
|
44
44
|
test/acceptance/*.js \
|
|
45
|
+
--growl \
|
|
45
46
|
test/*.js
|
|
46
47
|
|
|
47
48
|
test-compilers:
|
|
@@ -100,6 +101,9 @@ test-async-only:
|
|
|
100
101
|
--async-only \
|
|
101
102
|
test/acceptance/misc/asyncOnly
|
|
102
103
|
|
|
104
|
+
test-glob:
|
|
105
|
+
@./test/acceptance/glob/glob.sh
|
|
106
|
+
|
|
103
107
|
non-tty:
|
|
104
108
|
@./bin/mocha \
|
|
105
109
|
--reporter dot \
|
package/Readme.md
CHANGED
|
@@ -8,29 +8,117 @@
|
|
|
8
8
|
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
project : mocha
|
|
12
|
-
repo age : 1 year,
|
|
13
|
-
active :
|
|
14
|
-
commits :
|
|
15
|
-
files :
|
|
16
|
-
authors :
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
11
|
+
project : mocha
|
|
12
|
+
repo age : 1 year, 7 months
|
|
13
|
+
active : 272 days
|
|
14
|
+
commits : 1116
|
|
15
|
+
files : 123
|
|
16
|
+
authors :
|
|
17
|
+
504 TJ Holowaychuk 45.2%
|
|
18
|
+
389 Tj Holowaychuk 34.9%
|
|
19
|
+
31 Guillermo Rauch 2.8%
|
|
20
|
+
13 Attila Domokos 1.2%
|
|
21
|
+
9 John Firebaugh 0.8%
|
|
22
|
+
8 Jo Liss 0.7%
|
|
23
|
+
7 Nathan Rajlich 0.6%
|
|
24
|
+
6 James Carr 0.5%
|
|
25
|
+
6 Brendan Nee 0.5%
|
|
26
|
+
5 Aaron Heckmann 0.4%
|
|
27
|
+
4 hokaccha 0.4%
|
|
28
|
+
4 Xavier Antoviaque 0.4%
|
|
29
|
+
4 Joshua Krall 0.4%
|
|
30
|
+
3 Wil Moore III 0.3%
|
|
31
|
+
3 Jesse Dailey 0.3%
|
|
32
|
+
3 Nathan Bowser 0.3%
|
|
33
|
+
3 Tyson Tate 0.3%
|
|
34
|
+
3 Cory Thomas 0.3%
|
|
35
|
+
3 Ryunosuke SATO 0.3%
|
|
36
|
+
3 Paul Miller 0.3%
|
|
37
|
+
3 Ben Lindsey 0.3%
|
|
38
|
+
2 Forbes Lindesay 0.2%
|
|
39
|
+
2 Konstantin Käfer 0.2%
|
|
40
|
+
2 Brian Beck 0.2%
|
|
41
|
+
2 Merrick Christensen 0.2%
|
|
42
|
+
2 Michael Riley 0.2%
|
|
43
|
+
2 David Henderson 0.2%
|
|
44
|
+
2 Nathan Alderson 0.2%
|
|
45
|
+
2 Paul Armstrong 0.2%
|
|
46
|
+
2 Pete Hawkins 0.2%
|
|
47
|
+
2 Quang Van 0.2%
|
|
48
|
+
2 Raynos 0.2%
|
|
49
|
+
2 Jonas Westerlund 0.2%
|
|
50
|
+
2 Domenic Denicola 0.2%
|
|
51
|
+
2 Shawn Krisman 0.2%
|
|
52
|
+
2 Simon Gaeremynck 0.2%
|
|
53
|
+
2 FARKAS Máté 0.2%
|
|
54
|
+
2 Timo Tijhof 0.2%
|
|
55
|
+
2 Justin DuJardin 0.2%
|
|
56
|
+
2 Juzer Ali 0.2%
|
|
57
|
+
2 Ian Storm Taylor 0.2%
|
|
58
|
+
2 Arian Stolwijk 0.2%
|
|
59
|
+
2 domenic 0.2%
|
|
60
|
+
1 Richard Dingwall 0.1%
|
|
61
|
+
1 Russ Bradberry 0.1%
|
|
62
|
+
1 Sasha Koss 0.1%
|
|
63
|
+
1 Seiya Konno 0.1%
|
|
64
|
+
1 Standa Opichal 0.1%
|
|
65
|
+
1 Steve Mason 0.1%
|
|
66
|
+
1 Will Langstroth 0.1%
|
|
67
|
+
1 Yanis Wang 0.1%
|
|
68
|
+
1 Yuest Wang 0.1%
|
|
69
|
+
1 abrkn 0.1%
|
|
70
|
+
1 airportyh 0.1%
|
|
71
|
+
1 fengmk2 0.1%
|
|
72
|
+
1 tgautier@yahoo.com 0.1%
|
|
73
|
+
1 traleig1 0.1%
|
|
74
|
+
1 vlad 0.1%
|
|
75
|
+
1 yuitest 0.1%
|
|
76
|
+
1 Adam Crabtree 0.1%
|
|
77
|
+
1 Andreas Brekken 0.1%
|
|
78
|
+
1 Atsuya Takagi 0.1%
|
|
79
|
+
1 Austin Birch 0.1%
|
|
80
|
+
1 Bjørge Næss 0.1%
|
|
81
|
+
1 Brian Moore 0.1%
|
|
82
|
+
1 Bryan Donovan 0.1%
|
|
83
|
+
1 Casey Foster 0.1%
|
|
84
|
+
1 Corey Butler 0.1%
|
|
85
|
+
1 Dave McKenna 0.1%
|
|
86
|
+
1 Fedor Indutny 0.1%
|
|
87
|
+
1 Florian Margaine 0.1%
|
|
88
|
+
1 Frederico Silva 0.1%
|
|
89
|
+
1 Fredrik Lindin 0.1%
|
|
90
|
+
1 Gareth Murphy 0.1%
|
|
91
|
+
1 Gavin Mogan 0.1%
|
|
92
|
+
1 Greg Perkins 0.1%
|
|
93
|
+
1 Harry Brundage 0.1%
|
|
94
|
+
1 Herman Junge 0.1%
|
|
95
|
+
1 Ian Young 0.1%
|
|
96
|
+
1 Ivan 0.1%
|
|
97
|
+
1 Jaakko Salonen 0.1%
|
|
98
|
+
1 Jakub Nešetřil 0.1%
|
|
99
|
+
1 James Bowes 0.1%
|
|
100
|
+
1 James Lal 0.1%
|
|
101
|
+
1 Jason Barry 0.1%
|
|
102
|
+
1 Javier Aranda 0.1%
|
|
103
|
+
1 Jeff Kunkle 0.1%
|
|
104
|
+
1 Jonathan Creamer 0.1%
|
|
105
|
+
1 Jussi Virtanen 0.1%
|
|
106
|
+
1 Katie Gengler 0.1%
|
|
107
|
+
1 Kazuhito Hokamura 0.1%
|
|
108
|
+
1 Koen Punt 0.1%
|
|
109
|
+
1 Laszlo Bacsi 0.1%
|
|
110
|
+
1 László Bácsi 0.1%
|
|
111
|
+
1 Maciej Małecki 0.1%
|
|
112
|
+
1 Matt Robenolt 0.1%
|
|
113
|
+
1 Matt Smith 0.1%
|
|
114
|
+
1 Matthew Shanley 0.1%
|
|
115
|
+
1 Michael Schoonmaker 0.1%
|
|
116
|
+
1 Phil Sung 0.1%
|
|
117
|
+
1 R56 0.1%
|
|
30
118
|
```
|
|
31
119
|
|
|
32
120
|
## Links
|
|
33
121
|
|
|
34
122
|
- [Google Group](http://groups.google.com/group/mochajs)
|
|
35
123
|
- [Wiki](https://github.com/visionmedia/mocha/wiki)
|
|
36
|
-
- Mocha [Extensions and reporters](https://github.com/visionmedia/mocha/wiki)
|
|
124
|
+
- Mocha [Extensions and reporters](https://github.com/visionmedia/mocha/wiki)
|
package/_mocha.js
CHANGED
|
@@ -30,11 +30,11 @@ require.register = function (path, fn){
|
|
|
30
30
|
require.relative = function (parent) {
|
|
31
31
|
return function(p){
|
|
32
32
|
if ('.' != p.charAt(0)) return require(p);
|
|
33
|
-
|
|
33
|
+
|
|
34
34
|
var path = parent.split('/')
|
|
35
35
|
, segs = p.split('/');
|
|
36
36
|
path.pop();
|
|
37
|
-
|
|
37
|
+
|
|
38
38
|
for (var i = 0; i < segs.length; i++) {
|
|
39
39
|
var seg = segs[i];
|
|
40
40
|
if ('..' == seg) path.pop();
|
|
@@ -50,9 +50,9 @@ require.register("browser/debug.js", function(module, exports, require){
|
|
|
50
50
|
|
|
51
51
|
module.exports = function(type){
|
|
52
52
|
return function(){
|
|
53
|
-
|
|
54
53
|
}
|
|
55
54
|
};
|
|
55
|
+
|
|
56
56
|
}); // module: browser/debug.js
|
|
57
57
|
|
|
58
58
|
require.register("browser/diff.js", function(module, exports, require){
|
|
@@ -803,7 +803,6 @@ Hook.prototype.error = function(err){
|
|
|
803
803
|
this._error = err;
|
|
804
804
|
};
|
|
805
805
|
|
|
806
|
-
|
|
807
806
|
}); // module: hook.js
|
|
808
807
|
|
|
809
808
|
require.register("interfaces/bdd.js", function(module, exports, require){
|
|
@@ -817,7 +816,7 @@ var Suite = require('../suite')
|
|
|
817
816
|
|
|
818
817
|
/**
|
|
819
818
|
* BDD-style interface:
|
|
820
|
-
*
|
|
819
|
+
*
|
|
821
820
|
* describe('Array', function(){
|
|
822
821
|
* describe('#indexOf()', function(){
|
|
823
822
|
* it('should return -1 when not present', function(){
|
|
@@ -829,7 +828,7 @@ var Suite = require('../suite')
|
|
|
829
828
|
* });
|
|
830
829
|
* });
|
|
831
830
|
* });
|
|
832
|
-
*
|
|
831
|
+
*
|
|
833
832
|
*/
|
|
834
833
|
|
|
835
834
|
module.exports = function(suite){
|
|
@@ -874,7 +873,7 @@ module.exports = function(suite){
|
|
|
874
873
|
* and callback `fn` containing nested suites
|
|
875
874
|
* and/or tests.
|
|
876
875
|
*/
|
|
877
|
-
|
|
876
|
+
|
|
878
877
|
context.describe = context.context = function(title, fn){
|
|
879
878
|
var suite = Suite.create(suites[0], title);
|
|
880
879
|
suites.unshift(suite);
|
|
@@ -954,19 +953,19 @@ var Suite = require('../suite')
|
|
|
954
953
|
|
|
955
954
|
/**
|
|
956
955
|
* TDD-style interface:
|
|
957
|
-
*
|
|
956
|
+
*
|
|
958
957
|
* exports.Array = {
|
|
959
958
|
* '#indexOf()': {
|
|
960
959
|
* 'should return -1 when the value is not present': function(){
|
|
961
|
-
*
|
|
960
|
+
*
|
|
962
961
|
* },
|
|
963
962
|
*
|
|
964
963
|
* 'should return the correct index when the value is present': function(){
|
|
965
|
-
*
|
|
964
|
+
*
|
|
966
965
|
* }
|
|
967
966
|
* }
|
|
968
967
|
* };
|
|
969
|
-
*
|
|
968
|
+
*
|
|
970
969
|
*/
|
|
971
970
|
|
|
972
971
|
module.exports = function(suite){
|
|
@@ -1004,6 +1003,7 @@ module.exports = function(suite){
|
|
|
1004
1003
|
}
|
|
1005
1004
|
}
|
|
1006
1005
|
};
|
|
1006
|
+
|
|
1007
1007
|
}); // module: interfaces/exports.js
|
|
1008
1008
|
|
|
1009
1009
|
require.register("interfaces/index.js", function(module, exports, require){
|
|
@@ -1026,33 +1026,33 @@ var Suite = require('../suite')
|
|
|
1026
1026
|
|
|
1027
1027
|
/**
|
|
1028
1028
|
* QUnit-style interface:
|
|
1029
|
-
*
|
|
1029
|
+
*
|
|
1030
1030
|
* suite('Array');
|
|
1031
|
-
*
|
|
1031
|
+
*
|
|
1032
1032
|
* test('#length', function(){
|
|
1033
1033
|
* var arr = [1,2,3];
|
|
1034
1034
|
* ok(arr.length == 3);
|
|
1035
1035
|
* });
|
|
1036
|
-
*
|
|
1036
|
+
*
|
|
1037
1037
|
* test('#indexOf()', function(){
|
|
1038
1038
|
* var arr = [1,2,3];
|
|
1039
1039
|
* ok(arr.indexOf(1) == 0);
|
|
1040
1040
|
* ok(arr.indexOf(2) == 1);
|
|
1041
1041
|
* ok(arr.indexOf(3) == 2);
|
|
1042
1042
|
* });
|
|
1043
|
-
*
|
|
1043
|
+
*
|
|
1044
1044
|
* suite('String');
|
|
1045
|
-
*
|
|
1045
|
+
*
|
|
1046
1046
|
* test('#length', function(){
|
|
1047
1047
|
* ok('foo'.length == 3);
|
|
1048
1048
|
* });
|
|
1049
|
-
*
|
|
1049
|
+
*
|
|
1050
1050
|
*/
|
|
1051
1051
|
|
|
1052
1052
|
module.exports = function(suite){
|
|
1053
1053
|
var suites = [suite];
|
|
1054
1054
|
|
|
1055
|
-
suite.on('pre-require', function(context){
|
|
1055
|
+
suite.on('pre-require', function(context, file, mocha){
|
|
1056
1056
|
|
|
1057
1057
|
/**
|
|
1058
1058
|
* Execute before running tests.
|
|
@@ -1089,11 +1089,21 @@ module.exports = function(suite){
|
|
|
1089
1089
|
/**
|
|
1090
1090
|
* Describe a "suite" with the given `title`.
|
|
1091
1091
|
*/
|
|
1092
|
-
|
|
1092
|
+
|
|
1093
1093
|
context.suite = function(title){
|
|
1094
1094
|
if (suites.length > 1) suites.shift();
|
|
1095
1095
|
var suite = Suite.create(suites[0], title);
|
|
1096
1096
|
suites.unshift(suite);
|
|
1097
|
+
return suite;
|
|
1098
|
+
};
|
|
1099
|
+
|
|
1100
|
+
/**
|
|
1101
|
+
* Exclusive test-case.
|
|
1102
|
+
*/
|
|
1103
|
+
|
|
1104
|
+
context.suite.only = function(title, fn){
|
|
1105
|
+
var suite = context.suite(title, fn);
|
|
1106
|
+
mocha.grep(suite.fullTitle());
|
|
1097
1107
|
};
|
|
1098
1108
|
|
|
1099
1109
|
/**
|
|
@@ -1103,7 +1113,26 @@ module.exports = function(suite){
|
|
|
1103
1113
|
*/
|
|
1104
1114
|
|
|
1105
1115
|
context.test = function(title, fn){
|
|
1106
|
-
|
|
1116
|
+
var test = new Test(title, fn);
|
|
1117
|
+
suites[0].addTest(test);
|
|
1118
|
+
return test;
|
|
1119
|
+
};
|
|
1120
|
+
|
|
1121
|
+
/**
|
|
1122
|
+
* Exclusive test-case.
|
|
1123
|
+
*/
|
|
1124
|
+
|
|
1125
|
+
context.test.only = function(title, fn){
|
|
1126
|
+
var test = context.test(title, fn);
|
|
1127
|
+
mocha.grep(test.fullTitle());
|
|
1128
|
+
};
|
|
1129
|
+
|
|
1130
|
+
/**
|
|
1131
|
+
* Pending test case.
|
|
1132
|
+
*/
|
|
1133
|
+
|
|
1134
|
+
context.test.skip = function(title){
|
|
1135
|
+
context.test(title);
|
|
1107
1136
|
};
|
|
1108
1137
|
});
|
|
1109
1138
|
};
|
|
@@ -1127,7 +1156,7 @@ var Suite = require('../suite')
|
|
|
1127
1156
|
* suiteSetup(function(){
|
|
1128
1157
|
*
|
|
1129
1158
|
* });
|
|
1130
|
-
*
|
|
1159
|
+
*
|
|
1131
1160
|
* test('should return -1 when not present', function(){
|
|
1132
1161
|
*
|
|
1133
1162
|
* });
|
|
@@ -1547,7 +1576,7 @@ Mocha.prototype.run = function(fn){
|
|
|
1547
1576
|
var options = this.options;
|
|
1548
1577
|
var runner = new exports.Runner(suite);
|
|
1549
1578
|
var reporter = new this._reporter(runner);
|
|
1550
|
-
runner.ignoreLeaks = options.ignoreLeaks;
|
|
1579
|
+
runner.ignoreLeaks = false !== options.ignoreLeaks;
|
|
1551
1580
|
runner.asyncOnly = options.asyncOnly;
|
|
1552
1581
|
if (options.grep) runner.grep(options.grep, options.invert);
|
|
1553
1582
|
if (options.globals) runner.globals(options.globals);
|
|
@@ -1708,7 +1737,7 @@ exports.colors = {
|
|
|
1708
1737
|
/**
|
|
1709
1738
|
* Default symbol map.
|
|
1710
1739
|
*/
|
|
1711
|
-
|
|
1740
|
+
|
|
1712
1741
|
exports.symbols = {
|
|
1713
1742
|
ok: '✓',
|
|
1714
1743
|
err: '✖',
|
|
@@ -1814,10 +1843,7 @@ exports.list = function(failures){
|
|
|
1814
1843
|
|
|
1815
1844
|
// actual / expected diff
|
|
1816
1845
|
if ('string' == typeof actual && 'string' == typeof expected) {
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
if (len < 20) msg = errorDiff(err, 'Chars', escape);
|
|
1820
|
-
else msg = errorDiff(err, 'Words', escape);
|
|
1846
|
+
msg = errorDiff(err, 'Words', escape);
|
|
1821
1847
|
|
|
1822
1848
|
// linenos
|
|
1823
1849
|
var lines = msg.split('\n');
|
|
@@ -2332,8 +2358,6 @@ function HTML(runner, root) {
|
|
|
2332
2358
|
});
|
|
2333
2359
|
|
|
2334
2360
|
runner.on('test end', function(test){
|
|
2335
|
-
window.scrollTo(0, document.body.scrollHeight);
|
|
2336
|
-
|
|
2337
2361
|
// TODO: add to stats
|
|
2338
2362
|
var percent = stats.tests / this.total * 100 | 0;
|
|
2339
2363
|
if (progress) progress.update(percent).draw(ctx);
|
|
@@ -3078,7 +3102,7 @@ exports = module.exports = Min;
|
|
|
3078
3102
|
|
|
3079
3103
|
function Min(runner) {
|
|
3080
3104
|
Base.call(this, runner);
|
|
3081
|
-
|
|
3105
|
+
|
|
3082
3106
|
runner.on('start', function(){
|
|
3083
3107
|
// clear screen
|
|
3084
3108
|
process.stdout.write('\u001b[2J');
|
|
@@ -3098,10 +3122,10 @@ F.prototype = Base.prototype;
|
|
|
3098
3122
|
Min.prototype = new F;
|
|
3099
3123
|
Min.prototype.constructor = Min;
|
|
3100
3124
|
|
|
3125
|
+
|
|
3101
3126
|
}); // module: reporters/min.js
|
|
3102
3127
|
|
|
3103
3128
|
require.register("reporters/nyan.js", function(module, exports, require){
|
|
3104
|
-
|
|
3105
3129
|
/**
|
|
3106
3130
|
* Module dependencies.
|
|
3107
3131
|
*/
|
|
@@ -3247,44 +3271,39 @@ NyanCat.prototype.drawRainbow = function(){
|
|
|
3247
3271
|
NyanCat.prototype.drawNyanCat = function(status) {
|
|
3248
3272
|
var self = this;
|
|
3249
3273
|
var startWidth = this.scoreboardWidth + this.trajectories[0].length;
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
write(padding + '"" "" ');
|
|
3284
|
-
write('\n');
|
|
3285
|
-
break;
|
|
3286
|
-
}
|
|
3287
|
-
});
|
|
3274
|
+
var color = '\u001b[' + startWidth + 'C';
|
|
3275
|
+
var padding = '';
|
|
3276
|
+
|
|
3277
|
+
write(color);
|
|
3278
|
+
write('_,------,');
|
|
3279
|
+
write('\n');
|
|
3280
|
+
|
|
3281
|
+
write(color);
|
|
3282
|
+
padding = self.tick ? ' ' : ' ';
|
|
3283
|
+
write('_|' + padding + '/\\_/\\ ');
|
|
3284
|
+
write('\n');
|
|
3285
|
+
|
|
3286
|
+
write(color);
|
|
3287
|
+
padding = self.tick ? '_' : '__';
|
|
3288
|
+
var tail = self.tick ? '~' : '^';
|
|
3289
|
+
var face;
|
|
3290
|
+
switch (status) {
|
|
3291
|
+
case 'pass':
|
|
3292
|
+
face = '( ^ .^)';
|
|
3293
|
+
break;
|
|
3294
|
+
case 'fail':
|
|
3295
|
+
face = '( o .o)';
|
|
3296
|
+
break;
|
|
3297
|
+
default:
|
|
3298
|
+
face = '( - .-)';
|
|
3299
|
+
}
|
|
3300
|
+
write(tail + '|' + padding + face + ' ');
|
|
3301
|
+
write('\n');
|
|
3302
|
+
|
|
3303
|
+
write(color);
|
|
3304
|
+
padding = self.tick ? ' ' : ' ';
|
|
3305
|
+
write(padding + '"" "" ');
|
|
3306
|
+
write('\n');
|
|
3288
3307
|
|
|
3289
3308
|
this.cursorUp(this.numberOfLines);
|
|
3290
3309
|
};
|
|
@@ -3744,7 +3763,7 @@ function XUnit(runner) {
|
|
|
3744
3763
|
runner.on('pass', function(test){
|
|
3745
3764
|
tests.push(test);
|
|
3746
3765
|
});
|
|
3747
|
-
|
|
3766
|
+
|
|
3748
3767
|
runner.on('fail', function(test){
|
|
3749
3768
|
tests.push(test);
|
|
3750
3769
|
});
|
|
@@ -3761,7 +3780,7 @@ function XUnit(runner) {
|
|
|
3761
3780
|
}, false));
|
|
3762
3781
|
|
|
3763
3782
|
tests.forEach(test);
|
|
3764
|
-
console.log('</testsuite>');
|
|
3783
|
+
console.log('</testsuite>');
|
|
3765
3784
|
});
|
|
3766
3785
|
}
|
|
3767
3786
|
|
|
@@ -4063,8 +4082,7 @@ var EventEmitter = require('browser/events').EventEmitter
|
|
|
4063
4082
|
, Test = require('./test')
|
|
4064
4083
|
, utils = require('./utils')
|
|
4065
4084
|
, filter = utils.filter
|
|
4066
|
-
, keys = utils.keys
|
|
4067
|
-
, noop = function(){};
|
|
4085
|
+
, keys = utils.keys;
|
|
4068
4086
|
|
|
4069
4087
|
/**
|
|
4070
4088
|
* Non-enumerable globals.
|
|
@@ -4116,6 +4134,15 @@ function Runner(suite) {
|
|
|
4116
4134
|
this.globals(this.globalProps().concat(['errno']));
|
|
4117
4135
|
}
|
|
4118
4136
|
|
|
4137
|
+
/**
|
|
4138
|
+
* Wrapper for setImmediate, process.nextTick, or browser polyfill.
|
|
4139
|
+
*
|
|
4140
|
+
* @param {Function} fn
|
|
4141
|
+
* @api private
|
|
4142
|
+
*/
|
|
4143
|
+
|
|
4144
|
+
Runner.immediately = global.setImmediate || process.nextTick;
|
|
4145
|
+
|
|
4119
4146
|
/**
|
|
4120
4147
|
* Inherit from `EventEmitter.prototype`.
|
|
4121
4148
|
*/
|
|
@@ -4244,7 +4271,7 @@ Runner.prototype.fail = function(test, err){
|
|
|
4244
4271
|
if ('string' == typeof err) {
|
|
4245
4272
|
err = new Error('the string "' + err + '" was thrown, throw an Error :)');
|
|
4246
4273
|
}
|
|
4247
|
-
|
|
4274
|
+
|
|
4248
4275
|
this.emit('fail', test, err);
|
|
4249
4276
|
};
|
|
4250
4277
|
|
|
@@ -4301,7 +4328,7 @@ Runner.prototype.hook = function(name, fn){
|
|
|
4301
4328
|
});
|
|
4302
4329
|
}
|
|
4303
4330
|
|
|
4304
|
-
|
|
4331
|
+
Runner.immediately(function(){
|
|
4305
4332
|
next(0);
|
|
4306
4333
|
});
|
|
4307
4334
|
};
|
|
@@ -4544,14 +4571,16 @@ Runner.prototype.run = function(fn){
|
|
|
4544
4571
|
var self = this
|
|
4545
4572
|
, fn = fn || function(){};
|
|
4546
4573
|
|
|
4574
|
+
function uncaught(err){
|
|
4575
|
+
self.uncaught(err);
|
|
4576
|
+
}
|
|
4577
|
+
|
|
4547
4578
|
debug('start');
|
|
4548
4579
|
|
|
4549
4580
|
// callback
|
|
4550
4581
|
this.on('end', function(){
|
|
4551
4582
|
debug('end');
|
|
4552
|
-
process.removeListener('uncaughtException',
|
|
4553
|
-
self.uncaught(err);
|
|
4554
|
-
});
|
|
4583
|
+
process.removeListener('uncaughtException', uncaught);
|
|
4555
4584
|
fn(self.failures);
|
|
4556
4585
|
});
|
|
4557
4586
|
|
|
@@ -4563,9 +4592,7 @@ Runner.prototype.run = function(fn){
|
|
|
4563
4592
|
});
|
|
4564
4593
|
|
|
4565
4594
|
// uncaught exception
|
|
4566
|
-
process.on('uncaughtException',
|
|
4567
|
-
self.uncaught(err);
|
|
4568
|
-
});
|
|
4595
|
+
process.on('uncaughtException', uncaught);
|
|
4569
4596
|
|
|
4570
4597
|
return this;
|
|
4571
4598
|
};
|
|
@@ -4581,6 +4608,8 @@ Runner.prototype.run = function(fn){
|
|
|
4581
4608
|
|
|
4582
4609
|
function filterLeaks(ok, globals) {
|
|
4583
4610
|
return filter(globals, function(key){
|
|
4611
|
+
// Firefox and Chrome exposes iframes as index inside the window object
|
|
4612
|
+
if (/^d+/.test(key)) return false;
|
|
4584
4613
|
var matched = filter(ok, function(ok){
|
|
4585
4614
|
if (~ok.indexOf('*')) return 0 == key.indexOf(ok.split('*')[0]);
|
|
4586
4615
|
// Opera and IE expose global variables for HTML element IDs (issue #243)
|
|
@@ -5003,7 +5032,7 @@ exports.indexOf = function(arr, obj, start){
|
|
|
5003
5032
|
|
|
5004
5033
|
/**
|
|
5005
5034
|
* Array#reduce (<=IE8)
|
|
5006
|
-
*
|
|
5035
|
+
*
|
|
5007
5036
|
* @param {Array} array
|
|
5008
5037
|
* @param {Function} fn
|
|
5009
5038
|
* @param {Object} initial value
|