@@ -38,33 +38,29 @@ function runEndpointGen(name, opt={}) {
38
38
let options = opt . options || { } ;
39
39
let config = opt . config ;
40
40
41
- return new Promise ( ( resolve , reject ) => {
42
- let dir ;
43
- let gen = helpers
44
- . run ( require . resolve ( '../generators/endpoint' ) )
45
- . inTmpDir ( function ( _dir ) {
46
- // this will create a new temporary directory for each new generator run
47
- var done = this . async ( ) ;
48
- if ( DEBUG ) console . log ( `TEMP DIR: ${ _dir } ` ) ;
49
- dir = _dir ;
50
-
51
- // symlink our dependency directories
52
- return fs . symlinkAsync ( __dirname + '/fixtures/node_modules' , dir + '/node_modules' )
53
- . then ( done ) ;
54
- } )
55
- . withOptions ( options )
56
- . withArguments ( [ name ] )
57
- . withPrompts ( prompts ) ;
58
-
59
- if ( config ) {
60
- gen
61
- . withLocalConfig ( config ) ;
62
- }
63
-
41
+ let dir ;
42
+ let gen = helpers
43
+ . run ( require . resolve ( '../generators/endpoint' ) )
44
+ . inTmpDir ( function ( _dir ) {
45
+ // this will create a new temporary directory for each new generator run
46
+ var done = this . async ( ) ;
47
+ if ( DEBUG ) console . log ( `TEMP DIR: ${ _dir } ` ) ;
48
+ dir = _dir ;
49
+
50
+ // symlink our dependency directories
51
+ return fs . symlinkAsync ( __dirname + '/fixtures/node_modules' , dir + '/node_modules' )
52
+ . then ( done ) ;
53
+ } )
54
+ . withOptions ( options )
55
+ . withArguments ( [ name ] )
56
+ . withPrompts ( prompts ) ;
57
+
58
+ if ( config ) {
64
59
gen
65
- . on ( 'error' , reject )
66
- . on ( 'end' , ( ) => resolve ( dir ) ) ;
67
- } ) ;
60
+ . withLocalConfig ( config ) ;
61
+ }
62
+
63
+ return gen ;
68
64
}
69
65
70
66
let eslintCmd = path . join ( TEST_DIR , '/fixtures/node_modules/.bin/eslint' ) ;
@@ -105,7 +101,7 @@ describe('angular-fullstack:endpoint', function() {
105
101
_config [ 'generator-angular-fullstack' ] . insertSockets = false ;
106
102
_config [ 'generator-angular-fullstack' ] . insertModels = false ;
107
103
config = _config ;
108
- } )
104
+ } ) ,
109
105
] ) ;
110
106
} ) ;
111
107
0 commit comments