Skip to content

Commit 870a612

Browse files
ITLackeyITLackey
authored andcommitted
updated test to use chai-files
1 parent 8c38a63 commit 870a612

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

recipes/gulp-sitemap/assemblefile.spec.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
var chai = require( 'chai' );
44
var expect = chai.expect;
55
var path = require( 'path' );
6-
var fs = require( 'fs' );
7-
var chaiFs = require( 'chai-fs' );
6+
var chaiFiles = require( 'chai-files' );
87
var utils = require( './../lib/test-utils' );
98

10-
chai.use( chaiFs );
9+
chai.use( chaiFiles );
10+
var file = chaiFiles.file;
1111
var app = require( './assemblefile' );
1212

1313
describe( 'Gulp-sitemap using Assemble', function () {
@@ -23,9 +23,9 @@ describe( 'Gulp-sitemap using Assemble', function () {
2323
it( 'creates a three html files from hbs files in src/pages', function ( done ) {
2424
app.build( 'pages', function ( err ) {
2525
expect( err ).to.not.exist;
26-
expect( fs.existsSync( path.join( __dirname, './wwwroot/index.html' ) ) ).to.be.true;
27-
expect( fs.existsSync( path.join( __dirname, './wwwroot/about.html' ) ) ).to.be.true;
28-
expect( fs.existsSync( path.join( __dirname, './wwwroot/contact.html' ) ) ).to.be.true;
26+
expect( file ( path.join( __dirname, './wwwroot/index.html' ) ) ).to.exist;
27+
expect( file ( path.join( __dirname, './wwwroot/about.html' ) ) ).to.exist;
28+
expect( file ( path.join( __dirname, './wwwroot/contact.html' ) ) ).to.exist
2929
done();
3030
} );
3131
} );
@@ -35,8 +35,8 @@ describe( 'Gulp-sitemap using Assemble', function () {
3535
expect( err ).to.not.exist;
3636

3737
var p = path.join( __dirname, './wwwroot/sitemap.xml' );
38-
expect( fs.existsSync( p ) ).to.be.true;
39-
expect( p ).to.have.content.that.match( /urlset/ );
38+
expect( file ( p ) ).to.exist;
39+
expect( file ( p ) ).to.match( /urlset/ );
4040
done();
4141
} );
4242
} );

0 commit comments

Comments
 (0)