Skip to content

Commit eb98701

Browse files
committed
mock stream-mode vinyl files with from2-string
https://github.com/yoshuawuyts/from2-string
1 parent bcd7736 commit eb98701

File tree

4 files changed

+7
-13
lines changed

4 files changed

+7
-13
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
},
4747
"devDependencies": {
4848
"babel-eslint": "^6.1.0",
49+
"from2-string": "^1.1.0",
4950
"gulp": "^3.9.0",
5051
"istanbul": "^0.4.4",
5152
"mocha": "^2.2.5",

test/fixtures/fixable.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

test/fixtures/use-strict.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

test/linting.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/* global describe, it*/
22
'use strict';
33

4-
const fs = require('fs');
54
const path = require('path');
6-
const eslint = require('..');
75
const stream = require('stream');
6+
const eslint = require('..');
87
const File = require('vinyl');
8+
const from2string = require('from2-string');
99
const should = require('should');
1010
const BufferStreams = require('bufferstreams');
1111

@@ -94,7 +94,7 @@ describe('gulp-eslint plugin', () => {
9494
cwd: 'test/',
9595
base: 'test/fixtures',
9696
path: 'test/fixtures/use-strict.js',
97-
contents: fs.createReadStream('test/fixtures/use-strict.js')
97+
contents: from2string('(function () { void 0; })();')
9898
}));
9999
});
100100

@@ -127,11 +127,11 @@ describe('gulp-eslint plugin', () => {
127127

128128
lintStream.write(new File({
129129
path: 'test/fixtures/use-strict.js',
130-
contents: fs.createReadStream('test/fixtures/use-strict.js')
130+
contents: from2string('(function () { void 0; })();')
131131
}));
132132
lintStream.write(new File({
133133
path: 'test/fixtures/use-strict.js',
134-
contents: fs.createReadStream('test/fixtures/use-strict.js')
134+
contents: from2string('(function () { void 0; })();')
135135
}));
136136

137137
lintStream.end();
@@ -287,7 +287,7 @@ describe('gulp-eslint plugin', () => {
287287
})
288288
.end(new File({
289289
path: 'test/fixtures/fixable.js',
290-
contents: fs.createReadStream('test/fixtures/fixable.js')
290+
contents: from2string('var x = 0;; ')
291291
}));
292292
});
293293

0 commit comments

Comments
 (0)