forked from gruntjs/grunt-contrib-handlebars
-
Notifications
You must be signed in to change notification settings - Fork 0
/
handlebars_test.js
54 lines (43 loc) · 1.66 KB
/
handlebars_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
var grunt = require('grunt');
exports.handlebars = {
compile: function(test) {
'use strict';
test.expect(1);
var actual = grunt.file.read('tmp/handlebars.js');
var expected = grunt.file.read('test/expected/handlebars.js');
test.equal(actual, expected, 'should compile partials into Handlebars.partials and handlebars template into JST');
test.done();
},
wrapcompile: function(test) {
'use strict';
test.expect(1);
var actual = grunt.file.read('tmp/handlebarswrap.js');
var expected = grunt.file.read('test/expected/handlebarswrap.js');
test.equal(actual, expected, 'should compile partials into Handlebars.partials and handlebars template into JST');
test.done();
},
uglyfile: function(test) {
'use strict';
test.expect(1);
var actual = grunt.file.read('tmp/uglyfile.js');
var expected = grunt.file.read('test/expected/uglyfile.js');
test.equal(actual, expected, 'should escape single quotes in filenames');
test.done();
},
ns_nested: function(test) {
'use strict';
test.expect(1);
var actual = grunt.file.read('tmp/ns_nested.js');
var expected = grunt.file.read('test/expected/ns_nested.js');
test.equal(actual, expected, 'should define parts of nested namespaces');
test.done();
},
ns_nested_this: function(test) {
'use strict';
test.expect(1);
var actual = grunt.file.read('tmp/ns_nested_this.js');
var expected = grunt.file.read('test/expected/ns_nested.js'); // same as previous test
test.equal(actual, expected, 'should define parts of nested namespaces, ignoring this.');
test.done();
},
};