Skip to content

Commit 99a2a2f

Browse files
committed
Update requirejs to ^2.3.2
Also improve diffs in tests and fix tests.
1 parent b3686b5 commit 99a2a2f

File tree

5 files changed

+40
-28
lines changed

5 files changed

+40
-28
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"dependencies": {
1212
"event-stream": "^3.3.4",
1313
"gulp-util": "^3.0.7",
14-
"requirejs": "2.1.8"
14+
"requirejs": "^2.3.2"
1515
},
1616
"devDependencies": {
1717
"mocha": "*",

test/expected/complex_init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
define('simple_amd_file',[],function() {
32

43
var Mult = function(a, b) {
@@ -72,4 +71,5 @@ requirejs(['simple_amd_file', 'umd_file', 'complex_amd_file'], function(Mult, UM
7271
});
7372
define("../complex_init", function(){});
7473

74+
7575
define("../complex_init", function(){});

test/expected/simple_init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
define('vendor/simple_amd_file',[],function() {
32

43
var Mult = function(a, b) {
@@ -14,4 +13,5 @@ requirejs(['vendor/simple_amd_file'], function(Mult) {
1413
});
1514
define("simple_init", function(){});
1615

16+
1717
define("simple_init", function(){});

test/expected/umd_init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
define('vendor/simple_amd_file',[],function() {
32

43
var Mult = function(a, b) {
@@ -36,4 +35,5 @@ requirejs(['vendor/simple_amd_file', 'vendor/umd_file'], function(Mult, UMDLib)
3635
});
3736
define("umd_init", function(){});
3837

38+
3939
define("umd_init", function(){});

test/main.js

Lines changed: 36 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,18 @@ describe('gulp-requirejs', function() {
2727
});
2828

2929
stream.on('data', function(output) {
30-
should.exist(output);
31-
should.exist(output.path);
32-
should.exist(output.relative);
33-
should.exist(output.contents);
34-
35-
output.relative.should.equal('simple_init.js');
36-
String(output.contents).should.equal(fs.readFileSync('test/expected/simple_init.js', 'utf8'));
37-
done();
30+
try {
31+
should.exist(output);
32+
should.exist(output.path);
33+
should.exist(output.relative);
34+
should.exist(output.contents);
35+
36+
output.relative.should.equal('simple_init.js');
37+
String(output.contents).should.equal(fs.readFileSync('test/expected/simple_init.js', 'utf8'));
38+
done();
39+
} catch(e) {
40+
done(e);
41+
}
3842
});
3943
});
4044

@@ -59,14 +63,18 @@ describe('gulp-requirejs', function() {
5963
});
6064

6165
stream.on('data', function(output) {
62-
should.exist(output);
63-
should.exist(output.path);
64-
should.exist(output.relative);
65-
should.exist(output.contents);
66-
67-
output.relative.should.equal('umd_init.js');
68-
String(output.contents).should.equal(fs.readFileSync('test/expected/umd_init.js', 'utf8'));
69-
done();
66+
try {
67+
should.exist(output);
68+
should.exist(output.path);
69+
should.exist(output.relative);
70+
should.exist(output.contents);
71+
72+
output.relative.should.equal('umd_init.js');
73+
String(output.contents).should.equal(fs.readFileSync('test/expected/umd_init.js', 'utf8'));
74+
done();
75+
} catch(e) {
76+
done(e);
77+
}
7078
});
7179
});
7280

@@ -96,14 +104,18 @@ describe('gulp-requirejs', function() {
96104
});
97105

98106
stream.on('data', function(output) {
99-
should.exist(output);
100-
should.exist(output.path);
101-
should.exist(output.relative);
102-
should.exist(output.contents);
103-
104-
output.relative.should.equal('complex_init.js');
105-
String(output.contents).should.equal(fs.readFileSync('test/expected/complex_init.js', 'utf8'));
106-
done();
107+
try {
108+
should.exist(output);
109+
should.exist(output.path);
110+
should.exist(output.relative);
111+
should.exist(output.contents);
112+
113+
output.relative.should.equal('complex_init.js');
114+
String(output.contents).should.equal(fs.readFileSync('test/expected/complex_init.js', 'utf8'));
115+
done();
116+
} catch(e) {
117+
done(e);
118+
}
107119
});
108120
});
109121
});

0 commit comments

Comments
 (0)