@@ -293,9 +293,140 @@ describe('angular-fullstack:app', function() {
293293 }
294294 } ) ;
295295
296- //it('should run e2e tests successfully for production app', function (done) {
297- // runTest('grunt test:e2e:prod', this, done, 240000);
298- //});
296+ describe ( 'with sequelize models, auth' , function ( ) {
297+ var dir ;
298+ var testOptions = {
299+ buildtool : 'grunt' ,
300+ transpiler : 'babel' ,
301+ markup : 'jade' ,
302+ stylesheet : 'css' ,
303+ router : 'uirouter' ,
304+ testing : 'jasmine' ,
305+ odms : [ 'sequelize' ] ,
306+ auth : true ,
307+ oauth : [ 'twitterAuth' , 'facebookAuth' , 'googleAuth' ] ,
308+ socketio : true ,
309+ bootstrap : true ,
310+ uibootstrap : true
311+ } ;
312+
313+ beforeEach ( function ( ) {
314+ return runGen ( testOptions ) . then ( _dir => {
315+ dir = _dir ;
316+ } ) ;
317+ } ) ;
318+
319+ it ( 'should generate the proper files' , function ( ) {
320+ const expectedFiles = getExpectedFiles . app ( testOptions ) ;
321+ assert . file ( expectedFiles ) ;
322+ return assertOnlyFiles ( expectedFiles , path . normalize ( dir ) ) . should . be . fulfilled ( ) ;
323+ } ) ;
324+
325+ it ( 'passes JSCS' , function ( ) {
326+ return runCmd ( 'grunt jscs' ) . should . be . fulfilled ( ) ;
327+ } ) ;
328+
329+ it ( 'passes lint' , function ( ) {
330+ return runCmd ( 'grunt jshint' ) . should . be . fulfilled ( ) ;
331+ } ) ;
332+
333+ it ( 'should run client tests successfully' , function ( ) {
334+ return runCmd ( 'grunt test:client' ) . should . be . fulfilled ( ) ;
335+ } ) ;
336+
337+ it ( 'should run server tests successfully' , function ( ) {
338+ return runCmd ( 'grunt test:server' ) . should . be . fulfilled ( ) ;
339+ } ) ;
340+
341+ describe ( 'with a generated endpoint' , function ( ) {
342+ beforeEach ( function ( ) {
343+ getConfig ( path . join ( dir , '.yo-rc.json' ) ) . then ( config => {
344+ return runEndpointGen ( 'foo' , { config : config [ 'generator-angular-fullstack' ] } ) ;
345+ } ) ;
346+ } ) ;
347+
348+ it ( 'should run server tests successfully' , function ( ) {
349+ return runCmd ( 'grunt test:server' ) . should . be . fulfilled ( ) ;
350+ } ) ;
351+ } ) ;
352+
353+ if ( ! process . env . SKIP_E2E ) {
354+ it ( 'should run e2e tests successfully' , function ( ) {
355+ return runCmd ( 'grunt test:e2e:prod' ) . should . be . fulfilled ( ) ;
356+ } ) ;
357+
358+ it ( 'should run e2e tests successfully for production app' , function ( ) {
359+ return runCmd ( 'grunt test:e2e:prod' ) . should . be . fulfilled ( ) ;
360+ } ) ;
361+ }
362+ } ) ;
363+
364+ describe ( 'with TypeScript, Mocha + Chai (should) and no server options' , function ( ) {
365+ var dir ;
366+ var testOptions = {
367+ buildtool : 'grunt' ,
368+ transpiler : 'ts' ,
369+ markup : 'jade' ,
370+ stylesheet : 'stylus' ,
371+ router : 'uirouter' ,
372+ testing : 'mocha' ,
373+ chai : 'should' ,
374+ odms : [ ] ,
375+ auth : false ,
376+ oauth : [ ] ,
377+ socketio : false ,
378+ bootstrap : false ,
379+ uibootstrap : false
380+ } ;
381+
382+ beforeEach ( function ( ) {
383+ return runGen ( testOptions ) . then ( _dir => {
384+ dir = _dir ;
385+ } ) ;
386+ } ) ;
387+
388+ it ( 'should generate the proper files' , function ( ) {
389+ const expectedFiles = getExpectedFiles . app ( testOptions ) ;
390+ assert . file ( expectedFiles ) ;
391+ return assertOnlyFiles ( expectedFiles , path . normalize ( dir ) ) . should . be . fulfilled ( ) ;
392+ } ) ;
393+
394+ it ( 'passes JSCS' , function ( ) {
395+ return runCmd ( 'grunt jscs' ) . should . be . fulfilled ( ) ;
396+ } ) ;
397+
398+ it ( 'passes lint' , function ( ) {
399+ return runCmd ( 'grunt tslint' ) . should . be . fulfilled ( ) ;
400+ } ) ;
401+
402+ it ( 'should run client tests successfully' , function ( ) {
403+ return runCmd ( 'grunt test:client' ) . should . be . fulfilled ( ) ;
404+ } ) ;
405+
406+ it ( 'should run server tests successfully' , function ( ) {
407+ return runCmd ( 'grunt test:server' ) . should . be . fulfilled ( ) ;
408+ } ) ;
409+
410+ describe ( 'with a generated endpoint' , function ( ) {
411+ beforeEach ( function ( ) {
412+ getConfig ( path . join ( dir , '.yo-rc.json' ) ) . then ( config => {
413+ return runEndpointGen ( 'foo' , { config : config [ 'generator-angular-fullstack' ] } ) ;
414+ } ) ;
415+ } ) ;
416+
417+ it ( 'should run server tests successfully' , function ( ) {
418+ return runCmd ( 'grunt test:server' ) . should . be . fulfilled ( ) ;
419+ } ) ;
420+ } ) ;
421+
422+ if ( ! process . env . SKIP_E2E ) {
423+ it ( 'should run e2e tests successfully' , function ( ) {
424+ return runCmd ( 'grunt test:e2e:prod' ) . should . be . fulfilled ( ) ;
425+ } ) ;
426+
427+ it ( 'should run e2e tests successfully for production app' , function ( ) {
428+ return runCmd ( 'grunt test:e2e:prod' ) . should . be . fulfilled ( ) ;
429+ } ) ;
299430 }
300431 } ) ;
301432} ) ;
0 commit comments