22'use strict' ;
33var path = require ( 'path' ) ;
44var assert = require ( 'assert' ) ;
5- var gutil = require ( 'gulp-util ' ) ;
5+ var Vinyl = require ( 'vinyl ' ) ;
66var streamAssert = require ( 'stream-assert' ) ;
77var tempWrite = require ( 'temp-write' ) ;
88var jscs = require ( './' ) ;
@@ -38,13 +38,13 @@ it('should check code style of JS files', function (cb) {
3838 } ) )
3939 . pipe ( streamAssert . end ( cb ) ) ;
4040
41- stream . write ( new gutil . File ( {
41+ stream . write ( new Vinyl ( {
4242 base : __dirname ,
4343 path : path . join ( __dirname , 'fixture.js' ) ,
4444 contents : new Buffer ( 'var x = 1,y = 2;' )
4545 } ) ) ;
4646
47- stream . write ( new gutil . File ( {
47+ stream . write ( new Vinyl ( {
4848 base : __dirname ,
4949 path : path . join ( __dirname , 'fixture2.js' ) ,
5050 contents : new Buffer ( 'var x = { a: 1 };' )
@@ -65,7 +65,7 @@ it('should check code style of JS files using a preset', function (cb) {
6565 } ) )
6666 . pipe ( streamAssert . end ( cb ) ) ;
6767
68- stream . write ( new gutil . File ( {
68+ stream . write ( new Vinyl ( {
6969 base : __dirname ,
7070 path : path . join ( __dirname , 'fixture.js' ) ,
7171 contents : new Buffer ( 'var x = 1,y = 2;' )
@@ -81,7 +81,7 @@ it('should pass valid files', function (cb) {
8181 assert ( false , err ) ;
8282 } ) . on ( 'end' , cb ) . resume ( ) ;
8383
84- stream . write ( new gutil . File ( {
84+ stream . write ( new Vinyl ( {
8585 path : path . join ( __dirname , 'fixture.js' ) ,
8686 contents : new Buffer ( 'var x = 1; var y = 2;' )
8787 } ) ) ;
@@ -96,7 +96,7 @@ it('should respect "excludeFiles" from config', function (cb) {
9696 assert ( false , err ) ;
9797 } ) . on ( 'end' , cb ) . resume ( ) ;
9898
99- stream . write ( new gutil . File ( {
99+ stream . write ( new Vinyl ( {
100100 base : __dirname ,
101101 path : path . join ( __dirname , 'excluded.js' ) ,
102102 contents : new Buffer ( 'var x = { a: 1 };' )
@@ -118,7 +118,7 @@ it('should accept configPath options', function (cb) {
118118 } ) )
119119 . pipe ( streamAssert . end ( cb ) ) ;
120120
121- stream . write ( new gutil . File ( {
121+ stream . write ( new Vinyl ( {
122122 base : __dirname ,
123123 path : path . join ( __dirname , 'fixture.js' ) ,
124124 contents : new Buffer ( 'import x from \'x\'; var x = 1, y = 2;' )
@@ -138,7 +138,7 @@ it('should accept the fix option', function (cb) {
138138
139139 stream . on ( 'end' , cb ) ;
140140
141- stream . write ( new gutil . File ( {
141+ stream . write ( new Vinyl ( {
142142 base : __dirname ,
143143 path : path . join ( __dirname , 'fixture.js' ) ,
144144 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) {
169169 } ) )
170170 . pipe ( streamAssert . end ( done ) ) ;
171171
172- stream . write ( new gutil . File ( {
172+ stream . write ( new Vinyl ( {
173173 base : __dirname ,
174174 path : path . join ( __dirname , 'fixture.js' ) ,
175175 contents : new Buffer ( invalidJS )
176176 } ) ) ;
177177
178- stream . write ( new gutil . File ( {
178+ stream . write ( new Vinyl ( {
179179 base : __dirname ,
180180 path : path . join ( __dirname , 'fixture2.js' ) ,
181181 contents : new Buffer ( invalidJS )
@@ -201,7 +201,7 @@ describe('Reporter', function () {
201201 cb ( ) ;
202202 } ) . resume ( ) ;
203203
204- stream . write ( new gutil . File ( {
204+ stream . write ( new Vinyl ( {
205205 base : __dirname ,
206206 path : path . join ( __dirname , 'fixture.js' ) ,
207207 contents : new Buffer ( 'var x = 1,y = 2;' )
@@ -220,7 +220,7 @@ describe('Reporter', function () {
220220 cb ( ) ;
221221 } ) . resume ( ) ;
222222
223- stream . write ( new gutil . File ( {
223+ stream . write ( new Vinyl ( {
224224 base : __dirname ,
225225 path : path . join ( __dirname , 'fixture.js' ) ,
226226 contents : new Buffer ( 'var x = 1,y = 2;' )
@@ -239,7 +239,7 @@ describe('Reporter', function () {
239239
240240 stream . pipe ( jscs . reporter ( reporterFn ) ) . resume ( ) ;
241241
242- stream . write ( new gutil . File ( {
242+ stream . write ( new Vinyl ( {
243243 base : __dirname ,
244244 path : path . join ( __dirname , 'fixture.js' ) ,
245245 contents : new Buffer ( 'var x = 1,y = 2;' )
@@ -276,13 +276,13 @@ describe('Reporter', function () {
276276 cb ( ) ;
277277 } ) ) ;
278278
279- stream . write ( new gutil . File ( {
279+ stream . write ( new Vinyl ( {
280280 base : __dirname ,
281281 path : path . join ( __dirname , 'fixture.js' ) ,
282282 contents : new Buffer ( 'var x = 1,y = 2;' )
283283 } ) ) ;
284284
285- stream . write ( new gutil . File ( {
285+ stream . write ( new Vinyl ( {
286286 base : __dirname ,
287287 path : path . join ( __dirname , 'passing.js' ) ,
288288 contents : new Buffer ( 'var x = 1; var y = 2;' )
@@ -305,13 +305,13 @@ describe('Reporter', function () {
305305 } ) )
306306 . pipe ( streamAssert . end ( ) ) ;
307307
308- stream . write ( new gutil . File ( {
308+ stream . write ( new Vinyl ( {
309309 base : __dirname ,
310310 path : path . join ( __dirname , 'fixture.js' ) ,
311311 contents : new Buffer ( 'var x = 1,y = 2;' )
312312 } ) ) ;
313313
314- stream . write ( new gutil . File ( {
314+ stream . write ( new Vinyl ( {
315315 base : __dirname ,
316316 path : path . join ( __dirname , 'passing.js' ) ,
317317 contents : new Buffer ( 'var x = 1; var y = 2;' )
0 commit comments