forked from imlucas/gulp-juice
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.js
More file actions
25 lines (21 loc) · 699 Bytes
/
test.js
File metadata and controls
25 lines (21 loc) · 699 Bytes
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
var juice = require('./'),
assert = require('assert'),
fs = require('fs'),
gutil = require('gulp-util');
describe('gulp-juice', function() {
it('should work in buffer mode', function(done) {
var buf = fs.readFileSync('./test.html'),
juice = require('./')({}).on('data', function(file){
var html = file.contents.toString();
assert(html.indexOf('<style') === -1,
'after juicing should have no style tag');
}).on('end', done);
assert(buf.toString().indexOf('<style') > -1,
'should originally have style tag');
juice.write(new gutil.File({
contents: buf,
path: 'test.html'
}));
juice.end();
});
});