2
2
'use strict' ;
3
3
var path = require ( 'path' ) ;
4
4
var assert = require ( 'assert' ) ;
5
- var gutil = require ( 'gulp-util ' ) ;
5
+ var Vinyl = require ( 'vinyl ' ) ;
6
6
var streamAssert = require ( 'stream-assert' ) ;
7
7
var tempWrite = require ( 'temp-write' ) ;
8
8
var jscs = require ( './' ) ;
@@ -38,13 +38,13 @@ it('should check code style of JS files', function (cb) {
38
38
} ) )
39
39
. pipe ( streamAssert . end ( cb ) ) ;
40
40
41
- stream . write ( new gutil . File ( {
41
+ stream . write ( new Vinyl ( {
42
42
base : __dirname ,
43
43
path : path . join ( __dirname , 'fixture.js' ) ,
44
44
contents : new Buffer ( 'var x = 1,y = 2;' )
45
45
} ) ) ;
46
46
47
- stream . write ( new gutil . File ( {
47
+ stream . write ( new Vinyl ( {
48
48
base : __dirname ,
49
49
path : path . join ( __dirname , 'fixture2.js' ) ,
50
50
contents : new Buffer ( 'var x = { a: 1 };' )
@@ -65,7 +65,7 @@ it('should check code style of JS files using a preset', function (cb) {
65
65
} ) )
66
66
. pipe ( streamAssert . end ( cb ) ) ;
67
67
68
- stream . write ( new gutil . File ( {
68
+ stream . write ( new Vinyl ( {
69
69
base : __dirname ,
70
70
path : path . join ( __dirname , 'fixture.js' ) ,
71
71
contents : new Buffer ( 'var x = 1,y = 2;' )
@@ -81,7 +81,7 @@ it('should pass valid files', function (cb) {
81
81
assert ( false , err ) ;
82
82
} ) . on ( 'end' , cb ) . resume ( ) ;
83
83
84
- stream . write ( new gutil . File ( {
84
+ stream . write ( new Vinyl ( {
85
85
path : path . join ( __dirname , 'fixture.js' ) ,
86
86
contents : new Buffer ( 'var x = 1; var y = 2;' )
87
87
} ) ) ;
@@ -96,7 +96,7 @@ it('should respect "excludeFiles" from config', function (cb) {
96
96
assert ( false , err ) ;
97
97
} ) . on ( 'end' , cb ) . resume ( ) ;
98
98
99
- stream . write ( new gutil . File ( {
99
+ stream . write ( new Vinyl ( {
100
100
base : __dirname ,
101
101
path : path . join ( __dirname , 'excluded.js' ) ,
102
102
contents : new Buffer ( 'var x = { a: 1 };' )
@@ -118,7 +118,7 @@ it('should accept configPath options', function (cb) {
118
118
} ) )
119
119
. pipe ( streamAssert . end ( cb ) ) ;
120
120
121
- stream . write ( new gutil . File ( {
121
+ stream . write ( new Vinyl ( {
122
122
base : __dirname ,
123
123
path : path . join ( __dirname , 'fixture.js' ) ,
124
124
contents : new Buffer ( 'import x from \'x\'; var x = 1, y = 2;' )
@@ -138,7 +138,7 @@ it('should accept the fix option', function (cb) {
138
138
139
139
stream . on ( 'end' , cb ) ;
140
140
141
- stream . write ( new gutil . File ( {
141
+ stream . write ( new Vinyl ( {
142
142
base : __dirname ,
143
143
path : path . join ( __dirname , 'fixture.js' ) ,
144
144
contents : new Buffer ( 'var x = { a: 1, b: 2 }' )
@@ -169,13 +169,13 @@ it('should run autofix over as many errors as possible', function (done) {
169
169
} ) )
170
170
. pipe ( streamAssert . end ( done ) ) ;
171
171
172
- stream . write ( new gutil . File ( {
172
+ stream . write ( new Vinyl ( {
173
173
base : __dirname ,
174
174
path : path . join ( __dirname , 'fixture.js' ) ,
175
175
contents : new Buffer ( invalidJS )
176
176
} ) ) ;
177
177
178
- stream . write ( new gutil . File ( {
178
+ stream . write ( new Vinyl ( {
179
179
base : __dirname ,
180
180
path : path . join ( __dirname , 'fixture2.js' ) ,
181
181
contents : new Buffer ( invalidJS )
@@ -201,7 +201,7 @@ describe('Reporter', function () {
201
201
cb ( ) ;
202
202
} ) . resume ( ) ;
203
203
204
- stream . write ( new gutil . File ( {
204
+ stream . write ( new Vinyl ( {
205
205
base : __dirname ,
206
206
path : path . join ( __dirname , 'fixture.js' ) ,
207
207
contents : new Buffer ( 'var x = 1,y = 2;' )
@@ -220,7 +220,7 @@ describe('Reporter', function () {
220
220
cb ( ) ;
221
221
} ) . resume ( ) ;
222
222
223
- stream . write ( new gutil . File ( {
223
+ stream . write ( new Vinyl ( {
224
224
base : __dirname ,
225
225
path : path . join ( __dirname , 'fixture.js' ) ,
226
226
contents : new Buffer ( 'var x = 1,y = 2;' )
@@ -239,7 +239,7 @@ describe('Reporter', function () {
239
239
240
240
stream . pipe ( jscs . reporter ( reporterFn ) ) . resume ( ) ;
241
241
242
- stream . write ( new gutil . File ( {
242
+ stream . write ( new Vinyl ( {
243
243
base : __dirname ,
244
244
path : path . join ( __dirname , 'fixture.js' ) ,
245
245
contents : new Buffer ( 'var x = 1,y = 2;' )
@@ -276,13 +276,13 @@ describe('Reporter', function () {
276
276
cb ( ) ;
277
277
} ) ) ;
278
278
279
- stream . write ( new gutil . File ( {
279
+ stream . write ( new Vinyl ( {
280
280
base : __dirname ,
281
281
path : path . join ( __dirname , 'fixture.js' ) ,
282
282
contents : new Buffer ( 'var x = 1,y = 2;' )
283
283
} ) ) ;
284
284
285
- stream . write ( new gutil . File ( {
285
+ stream . write ( new Vinyl ( {
286
286
base : __dirname ,
287
287
path : path . join ( __dirname , 'passing.js' ) ,
288
288
contents : new Buffer ( 'var x = 1; var y = 2;' )
@@ -305,13 +305,13 @@ describe('Reporter', function () {
305
305
} ) )
306
306
. pipe ( streamAssert . end ( ) ) ;
307
307
308
- stream . write ( new gutil . File ( {
308
+ stream . write ( new Vinyl ( {
309
309
base : __dirname ,
310
310
path : path . join ( __dirname , 'fixture.js' ) ,
311
311
contents : new Buffer ( 'var x = 1,y = 2;' )
312
312
} ) ) ;
313
313
314
- stream . write ( new gutil . File ( {
314
+ stream . write ( new Vinyl ( {
315
315
base : __dirname ,
316
316
path : path . join ( __dirname , 'passing.js' ) ,
317
317
contents : new Buffer ( 'var x = 1; var y = 2;' )
0 commit comments