@@ -42,28 +42,28 @@ describe('angular-fullstack generator', function () {
4242 *
4343 * @param {Array } expectedFiles - array of files
4444 * @param {Function } done - callback(error{Error})
45- * @param {String } path - top level path to assert files at (optional)
45+ * @param {String } topLevelPath - top level path to assert files at (optional)
4646 * @param {Array } skip - array of paths to skip/ignore (optional)
4747 *
4848 */
49- function assertOnlyFiles ( expectedFiles , done , path , skip ) {
50- path = path || './' ;
49+ function assertOnlyFiles ( expectedFiles , done , topLevelPath , skip ) {
50+ topLevelPath = topLevelPath || './' ;
5151 skip = skip || [ 'node_modules' , 'client/bower_components' ] ;
5252
53- recursiveReadDir ( path , skip , function ( err , actualFiles ) {
53+ recursiveReadDir ( topLevelPath , skip , function ( err , actualFiles ) {
5454 if ( err ) { return done ( err ) ; }
5555 var files = actualFiles . concat ( ) ;
5656
5757 expectedFiles . forEach ( function ( file , i ) {
58- var index = files . indexOf ( file ) ;
58+ var index = files . indexOf ( path . normalize ( file ) ) ;
5959 if ( index >= 0 ) {
6060 files . splice ( index , 1 ) ;
6161 }
6262 } ) ;
6363
6464 if ( files . length !== 0 ) {
6565 err = new Error ( 'unexpected files found' ) ;
66- err . expected = '' ;
66+ err . expected = expectedFiles . join ( '\n' ) ;
6767 err . actual = files . join ( '\n' ) ;
6868 return done ( err ) ;
6969 }
0 commit comments