less_test.js
2.3 KB
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
var grunt = require('grunt');
var fs = require('fs');
exports.less = {
compile: function(test) {
'use strict';
test.expect(2);
var actual = grunt.file.read('tmp/less.css');
var expected = grunt.file.read('test/expected/less.css');
test.equal(expected, actual, 'should compile less, with the ability to handle imported files from alternate include paths');
actual = grunt.file.read('tmp/concat.css');
expected = grunt.file.read('test/expected/concat.css');
test.equal(expected, actual, 'should concat output when passed an array');
test.done();
},
compress: function(test) {
'use strict';
test.expect(1);
var actual = grunt.file.read('tmp/compress.css');
var expected = grunt.file.read('test/expected/compress.css');
test.equal(expected, actual, 'should compress output when compress option is true');
test.done();
},
nopaths: function(test) {
'use strict';
test.expect(1);
var actual = grunt.file.read('tmp/nopaths.css');
var expected = grunt.file.read('test/expected/nopaths.css');
test.equal(expected, actual, 'should default paths to the dirname of the less file');
test.done();
},
yuicompress: function(test) {
'use strict';
var actual, expected;
test.expect(2);
actual = grunt.file.read('tmp/yuicompress.css');
expected = grunt.file.read('test/expected/yuicompress.css');
test.equal(expected, actual, 'should yuicompress output when yuicompress option is true');
actual = grunt.file.read('tmp/yuicompressReport.css');
expected = grunt.file.read('test/expected/yuicompressReport.css');
test.equal(expected, actual, 'should yuicompress output when yuicompress option is true and concating is enable');
test.done();
},
ieCompat: function(test) {
'use strict';
var actual, expected;
test.expect(2);
actual = grunt.file.read('tmp/ieCompatFalse.css');
expected = grunt.file.read('test/expected/ieCompatFalse.css');
test.equal(expected, actual, 'should generate data-uris no matter the size when ieCompat option is true');
actual = grunt.file.read('tmp/ieCompatTrue.css');
expected = grunt.file.read('test/expected/ieCompatTrue.css');
test.equal(expected, actual, 'should generate data-uris only when under the 32KB mark for Internet Explorer 8');
test.done();
}
};