3
3
var chai = require ( 'chai' ) ;
4
4
var expect = chai . expect ;
5
5
var path = require ( 'path' ) ;
6
- var fs = require ( 'fs' ) ;
7
- var chaiFs = require ( 'chai-fs' ) ;
6
+ var chaiFiles = require ( 'chai-files' ) ;
8
7
var utils = require ( './../lib/test-utils' ) ;
9
8
10
- chai . use ( chaiFs ) ;
9
+ chai . use ( chaiFiles ) ;
10
+ var file = chaiFiles . file ;
11
11
var app = require ( './assemblefile' ) ;
12
12
13
13
describe ( 'Gulp-sitemap using Assemble' , function ( ) {
@@ -23,9 +23,9 @@ describe( 'Gulp-sitemap using Assemble', function () {
23
23
it ( 'creates a three html files from hbs files in src/pages' , function ( done ) {
24
24
app . build ( 'pages' , function ( err ) {
25
25
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
29
29
done ( ) ;
30
30
} ) ;
31
31
} ) ;
@@ -35,8 +35,8 @@ describe( 'Gulp-sitemap using Assemble', function () {
35
35
expect ( err ) . to . not . exist ;
36
36
37
37
var p = path . join ( __dirname , './wwwroot/sitemap.xml' ) ;
38
- expect ( fs . existsSync ( p ) ) . to . be . true ;
39
- expect ( p ) . to . have . content . that . match ( / u r l s e t / ) ;
38
+ expect ( file ( p ) ) . to . exist ;
39
+ expect ( file ( p ) ) . to . match ( / u r l s e t / ) ;
40
40
done ( ) ;
41
41
} ) ;
42
42
} ) ;
0 commit comments