@@ -38,33 +38,29 @@ function runEndpointGen(name, opt={}) {
3838 let options = opt . options || { } ;
3939 let config = opt . config ;
4040
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 ) {
6459 gen
65- . on ( 'error' , reject )
66- . on ( 'end' , ( ) => resolve ( dir ) ) ;
67- } ) ;
60+ . withLocalConfig ( config ) ;
61+ }
62+
63+ return gen ;
6864}
6965
7066let eslintCmd = path . join ( TEST_DIR , '/fixtures/node_modules/.bin/eslint' ) ;
@@ -105,11 +101,11 @@ describe('angular-fullstack:endpoint', function() {
105101 _config [ 'generator-angular-fullstack' ] . insertSockets = false ;
106102 _config [ 'generator-angular-fullstack' ] . insertModels = false ;
107103 config = _config ;
108- } )
104+ } ) ,
109105 ] ) ;
110106 } ) ;
111107
112- describe ( `with a generated endpont 'foo'` , function ( ) {
108+ describe ( `with a generated endpoint 'foo'` , function ( ) {
113109 var dir ;
114110 beforeEach ( function ( ) {
115111 return runEndpointGen ( 'foo' , { config : config [ 'generator-angular-fullstack' ] } ) . then ( _dir => {
@@ -131,7 +127,7 @@ describe('angular-fullstack:endpoint', function() {
131127 } ) ;
132128 } ) ;
133129
134- describe ( 'with a generated capitalized endpont ' , function ( ) {
130+ describe ( 'with a generated capitalized endpoint ' , function ( ) {
135131 var dir ;
136132 beforeEach ( function ( ) {
137133 return runEndpointGen ( 'Foo' , { config : config [ 'generator-angular-fullstack' ] } ) . then ( _dir => {
@@ -153,7 +149,7 @@ describe('angular-fullstack:endpoint', function() {
153149 } ) ;
154150 } ) ;
155151
156- describe ( 'with a generated path name endpont ' , function ( ) {
152+ describe ( 'with a generated path name endpoint ' , function ( ) {
157153 var dir ;
158154 beforeEach ( function ( ) {
159155 return runEndpointGen ( 'foo/bar' , { config : config [ 'generator-angular-fullstack' ] } ) . then ( _dir => {
0 commit comments