cssmin_test.js
1.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
'use strict';
var grunt = require('grunt');
exports.cssmin = {
main: function(test) {
test.expect(1);
var expect = grunt.file.read('test/expected/style.css');
var result = grunt.file.read('tmp/style.css');
test.equal(expect, result, 'should concat and minify an array of css files in order using clean-css');
test.done();
},
with_banner: function(test) {
test.expect(1);
var expect = grunt.file.read('test/expected/with-banner.css');
var result = grunt.file.read('tmp/with-banner.css');
test.equal(expect, result, 'should concat, minify and prefix banner');
test.done();
},
empty: function(test) {
test.expect(1);
test.ok(!grunt.file.exists('tmp/idontexist.css'), 'Empty minified file should not exist');
test.done();
},
remove_first_comment: function(test) {
test.expect(1);
var expect = grunt.file.read('test/expected/input_bannered.css');
var result = grunt.file.read('tmp/remove_first_comment.css');
test.equal(expect, result, 'should minify and replace banner');
test.done();
},
imports: function(test) {
test.expect(1);
var expect = grunt.file.read('test/expected/inline_import.css');
var result = grunt.file.read('tmp/inline_import.css');
test.equal(expect, result, 'should inline @import');
test.done();
}
};