22
33// Imports
44import { assertDeepStrictEqual } from 'assert-deep-strict-equal' ;
5- import { readdirSync , readFileSync } from 'fs' ;
5+ import fs from 'fs' ;
66import Vinyl from 'vinyl' ;
77import sinon from 'sinon' ;
88import slash from 'slash' ;
@@ -11,7 +11,7 @@ import slash from 'slash';
1111import { htmlValidator } from '../dist/html-validator.js' ;
1212const analyzedFiles = { valid : [ ] , invalid : [ ] } ;
1313console . log ( ' Input HTML files for validation:' ) ;
14- readdirSync ( 'spec/html' ) . forEach ( file => console . log ( ' spec/html/' + file ) ) ;
14+ fs . readdirSync ( 'spec/html' ) . forEach ( file => console . log ( ' spec/html/' + file ) ) ;
1515
1616////////////////////////////////////////////////////////////////////////////////////////////////////
1717describe ( 'The gulp-w3c-html-validator analyzer()' , ( ) => {
@@ -21,7 +21,7 @@ describe('The gulp-w3c-html-validator analyzer()', () => {
2121 path : 'spec/html/valid.html' ,
2222 cwd : 'spec/' ,
2323 base : 'spec/html/' ,
24- contents : readFileSync ( 'spec/html/valid.html' ) ,
24+ contents : fs . readFileSync ( 'spec/html/valid.html' ) ,
2525 } ;
2626 const mockFile = new Vinyl ( vinylOptions ) ;
2727 const stream = htmlValidator . analyzer ( ) ;
@@ -44,7 +44,7 @@ describe('The gulp-w3c-html-validator analyzer()', () => {
4444 status : 200 ,
4545 messages : [ ] ,
4646 display : null ,
47- html : readFileSync ( 'spec/html/valid.html' ) . toString ( ) ,
47+ html : fs . readFileSync ( 'spec/html/valid.html' ) . toString ( ) ,
4848 } ,
4949 } ;
5050 if ( process . platform === 'win32' ) //todo: ensure title is the same on all platforms
@@ -62,7 +62,7 @@ describe('The gulp-w3c-html-validator analyzer()', () => {
6262 path : 'spec/html/invalid.html' ,
6363 cwd : 'spec/' ,
6464 base : 'spec/html/' ,
65- contents : readFileSync ( 'spec/html/invalid.html' ) ,
65+ contents : fs . readFileSync ( 'spec/html/invalid.html' ) ,
6666 } ;
6767 const mockFile = new Vinyl ( vinylOptions ) ;
6868 const stream = htmlValidator . analyzer ( ) ;
@@ -97,7 +97,7 @@ describe('The analyzer() ignoreMessages option', () => {
9797 path : 'spec/html/invalid.html' ,
9898 cwd : 'spec/' ,
9999 base : 'spec/html/' ,
100- contents : readFileSync ( 'spec/html/invalid.html' ) ,
100+ contents : fs . readFileSync ( 'spec/html/invalid.html' ) ,
101101 } ;
102102 const mockFile = new Vinyl ( vinylOptions ) ;
103103 const ignore = / ^ E l e m e n t .b l o c k q u o t e . n o t a l l o w e d a s c h i l d o f e l e m e n t / ;
@@ -134,7 +134,7 @@ describe('The gulp-w3c-html-validator reporter()', () => {
134134 path : 'spec/html/valid.html' ,
135135 cwd : 'spec/' ,
136136 base : 'spec/html/' ,
137- contents : readFileSync ( 'spec/html/valid.html' ) ,
137+ contents : fs . readFileSync ( 'spec/html/valid.html' ) ,
138138 } ;
139139 const mockFile = new Vinyl ( vinylOptions ) ;
140140 const stream = htmlValidator . reporter ( ) ;
@@ -162,7 +162,7 @@ describe('The gulp-w3c-html-validator reporter()', () => {
162162 path : 'spec/html/invalid.html' ,
163163 cwd : 'spec/' ,
164164 base : 'spec/html/' ,
165- contents : readFileSync ( 'spec/html/invalid.html' ) ,
165+ contents : fs . readFileSync ( 'spec/html/invalid.html' ) ,
166166 w3cHtmlValidator : analyzedFiles . invalid [ 0 ] . w3cHtmlValidator ,
167167 } ;
168168 const mockFile = new Vinyl ( vinylOptions ) ;
0 commit comments