@@ -42,28 +42,28 @@ describe('angular-fullstack generator', function () {
42
42
*
43
43
* @param {Array } expectedFiles - array of files
44
44
* @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)
46
46
* @param {Array } skip - array of paths to skip/ignore (optional)
47
47
*
48
48
*/
49
- function assertOnlyFiles ( expectedFiles , done , path , skip ) {
50
- path = path || './' ;
49
+ function assertOnlyFiles ( expectedFiles , done , topLevelPath , skip ) {
50
+ topLevelPath = topLevelPath || './' ;
51
51
skip = skip || [ 'node_modules' , 'client/bower_components' ] ;
52
52
53
- recursiveReadDir ( path , skip , function ( err , actualFiles ) {
53
+ recursiveReadDir ( topLevelPath , skip , function ( err , actualFiles ) {
54
54
if ( err ) { return done ( err ) ; }
55
55
var files = actualFiles . concat ( ) ;
56
56
57
57
expectedFiles . forEach ( function ( file , i ) {
58
- var index = files . indexOf ( file ) ;
58
+ var index = files . indexOf ( path . normalize ( file ) ) ;
59
59
if ( index >= 0 ) {
60
60
files . splice ( index , 1 ) ;
61
61
}
62
62
} ) ;
63
63
64
64
if ( files . length !== 0 ) {
65
65
err = new Error ( 'unexpected files found' ) ;
66
- err . expected = '' ;
66
+ err . expected = expectedFiles . join ( '\n' ) ;
67
67
err . actual = files . join ( '\n' ) ;
68
68
return done ( err ) ;
69
69
}
0 commit comments