This repository has been archived by the owner on Dec 1, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathpackager_test.js
76 lines (59 loc) · 2.31 KB
/
packager_test.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
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
'use strict';
var grunt = require('grunt');
exports.packager = {
// simple compat build, one project
default_options: function(test){
test.expect(1);
var actual = grunt.file.read('tmp/all.js');
var expected = grunt.file.read('test/expected/all.js');
test.equal(actual, expected, 'should be exact for all build.');
test.done();
},
// simple no-compat build, one project
nocompat_options: function(test){
test.expect(1);
var actual = grunt.file.read('tmp/nocompat.js');
var expected = grunt.file.read('test/expected/nocompat.js');
test.equal(actual, expected, 'should be exact for nocompat build.');
test.done();
},
// multi project build with dependency defined with `package/*`
multipackage: function(test){
test.expect(1);
var actual = grunt.file.read('tmp/multipackage.js');
var expected = grunt.file.read('test/expected/multipackage.js');
test.equal(actual, expected, 'should be exact for multipackage build.');
test.done();
},
// multi project build with simple option `only: 'package'`
multipackage_partial_simple: function(test){
test.expect(1);
var actual = grunt.file.read('tmp/multipackage_partial_simple.js');
var expected = grunt.file.read('test/expected/multipackage_partial_simple.js');
test.equal(actual, expected, 'should be exact for multipackage build with specified "only".');
test.done();
},
// multi project build with wildcard option `only: 'package/*'`
multipackage_partial_widcard: function(test){
test.expect(1);
var actual = grunt.file.read('tmp/multipackage_partial_widcard.js');
var expected = grunt.file.read('test/expected/multipackage_partial_widcard.js');
test.equal(actual, expected, 'should be exact for multipackage build with specified "only".');
test.done();
},
// option `callback`
callback: function(test){
test.expect(1);
var actual = grunt.file.read('tmp/callbackOutput.js');
var expected = grunt.file.read('test/expected/all.js');
test.equal(actual, expected, 'should be exact same content for data ouputed via callback function');
test.done();
},
// option `noOutput
noOutput: function(test){
test.expect(1);
var exists = grunt.file.exists('tmp/noOutput.js');
test.equal(exists, false, 'file should not exist');
test.done();
},
};