forked from koistya/gulp-csscomb
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtest.js
38 lines (27 loc) · 891 Bytes
/
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
/*!
* gulp-csscomb | https://github.com/koistya/gulp-csscomb
* Copyright (c) Konstantin Tarkus (@koistya). See LICENSE.txt
*/
/* global describe, it */
'use strict';
var assert = require('assert');
var gutil = require('gulp-util');
var csscomb = require('./index');
var cssinput = 'h1 { color: yellow; } \n h1 { font-size: 2em; }';
var cssoutput = 'h1\n{\n color: yellow;\n}\nh1\n{\n font-size: 2em;\n}\n';
describe('gulp-csscomb', function() {
it('should format CSS coding style', function (cb) {
var stream = csscomb();
stream.once('data', function(file) {
// make sure it came out the same way it went in
assert(file.isStream);
// check the contents
assert.equal(String(file.contents), cssoutput);
cb();
});
stream.write(new gutil.File({
path: 'style.css',
contents: new Buffer(cssinput)
}));
});
});