-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathtest.js
45 lines (36 loc) · 1.12 KB
/
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
/**
* To test install mocha:
* npm install -g mocha
*
* Run mocha:
* mocha
*/
/* global describe, it */
'use strict';
var assert = require('assert');
var gutil = require('gulp-util');
var pxtorem = require('./');
describe('gulp-pixrem', function() {
it('should postprocess CSS using gulp-pxtorem with the default pixel root value', function(done) {
var stream = pxtorem();
stream.on('data', function(data) {
assert.equal(data.contents.toString(), 'code { font-size: 1rem; }');
done();
});
stream.write(new gutil.File({
contents: new Buffer('code { font-size: 16px; }')
}));
});
it('should postprocess CSS using gulp-pxtorem with a custom pixel root value', function(done) {
var stream = pxtorem({
root_value: 10
});
stream.on('data', function(data) {
assert.equal(data.contents.toString(), 'code { font-size: 1.6rem; }');
done();
});
stream.write(new gutil.File({
contents: new Buffer('code { font-size: 16px; }')
}));
});
});