11'use strict' ;
22
33var helper = require ( '../../helpers/angularity-test' ) ,
4- matchers = require ( '../../helpers/jasmine-matchers' ) ;
4+ matchers = require ( '../../helpers/jasmine-matchers' ) ,
5+ platform = require ( '../../../lib/config/platform' ) ;
56
67var fastIt = helper . jasmineFactory ( {
78 before : 0 ,
@@ -15,63 +16,63 @@ var slowIt = helper.jasmineFactory({
1516
1617var FLAGS = [ 'project' , 'external' , 'codestyle' , 'templates' , 'launch' ] ;
1718
18- describe ( 'The Angularity webstorm task' , function ( ) {
19+ // TODO @bholloway appveyor fails any webstorm command with exitcode 1 and nothing on stdout or stderr
20+ if ( ! platform . isAppveyor ( ) ) {
1921
20- beforeEach ( matchers . addMatchers ) ;
22+ describe ( 'The Angularity webstorm task' , function ( ) {
2123
22- beforeEach ( customMatchers ) ;
24+ beforeEach ( matchers . addMatchers ) ;
2325
24- beforeEach ( helper . getTimeoutSwitch ( 60000 ) ) ;
26+ beforeEach ( customMatchers ) ;
2527
26- afterEach ( helper . getTimeoutSwitch ( ) ) ;
28+ beforeEach ( helper . getTimeoutSwitch ( 60000 ) ) ;
2729
28- afterEach ( helper . cleanUp ) ;
30+ afterEach ( helper . getTimeoutSwitch ( ) ) ;
2931
30- // TODO @bholloway appveyor fails command with exitcode 1 and nothing on stdout or stderr
31- var platform = require ( '../../../lib/config/platform' ) ;
32- if ( ! platform . isAppveyor ( ) ) {
33- describe ( 'should display help when requested' , function ( done ) {
34- helper . runner . create ( )
35- . addInvocation ( 'webstorm --help' )
36- . addInvocation ( 'webstorm -h' )
37- . forEach ( fastIt ( expectations ) )
38- . finally ( done ) ;
32+ afterEach ( helper . cleanUp ) ;
3933
40- function expectations ( testCase ) {
41- expect ( testCase . stderr ) . toBeBuildHelpWithError ( false ) ;
42- }
43- } ) ;
44- }
34+ describe ( 'should display help when requested' , function ( done ) {
35+ helper . runner . create ( )
36+ . addInvocation ( 'webstorm --help' )
37+ . addInvocation ( 'webstorm -h' )
38+ . forEach ( fastIt ( expectations ) )
39+ . finally ( done ) ;
4540
46- describe ( 'should fail where angularity.json is not present' , function ( done ) {
47- helper . runner . create ( )
48- . addSource ( 'minimal-es5' )
49- . withSourceFilter ( function removeBuildFiles ( value ) {
50- return ! ( / a n g u l a r i t y .j s o n $ / . test ( value ) ) ;
51- } )
52- . addInvocation ( 'webstorm' , FLAGS . map ( composeOption ( false ) ) )
53- . forEach ( slowIt ( expectations ) )
54- . finally ( done ) ;
55-
56- function expectations ( testCase ) {
57- expect ( testCase . stderr ) . toBeBuildHelpWithError ( true ) ;
58- }
59- } ) ;
41+ function expectations ( testCase ) {
42+ expect ( testCase . stderr ) . toBeBuildHelpWithError ( false ) ;
43+ }
44+ } ) ;
6045
61- describe ( 'should operate with all flags false' , function ( done ) {
62- helper . runner . create ( )
63- . addSource ( 'minimal-es5' )
64- . addInvocation ( 'webstorm' , FLAGS . map ( composeOption ( false ) ) )
65- . forEach ( slowIt ( expectations ) )
66- . finally ( done ) ;
46+ describe ( 'should fail where angularity.json is not present' , function ( done ) {
47+ helper . runner . create ( )
48+ . addSource ( 'minimal-es5' )
49+ . withSourceFilter ( function removeBuildFiles ( value ) {
50+ return ! ( / a n g u l a r i t y .j s o n $ / . test ( value ) ) ;
51+ } )
52+ . addInvocation ( 'webstorm' , FLAGS . map ( composeOption ( false ) ) )
53+ . forEach ( slowIt ( expectations ) )
54+ . finally ( done ) ;
6755
68- function expectations ( testCase ) {
69- expect ( testCase . stdout ) . toBeTask ( 'webstorm' ) ;
70- }
71- } ) ;
56+ function expectations ( testCase ) {
57+ expect ( testCase . stderr ) . toBeBuildHelpWithError ( true ) ;
58+ }
59+ } ) ;
7260
73- // TODO @bholloway more test coverage on webstorm task
74- } ) ;
61+ describe ( 'should operate with all flags false' , function ( done ) {
62+ helper . runner . create ( )
63+ . addSource ( 'minimal-es5' )
64+ . addInvocation ( 'webstorm' , FLAGS . map ( composeOption ( false ) ) )
65+ . forEach ( slowIt ( expectations ) )
66+ . finally ( done ) ;
67+
68+ function expectations ( testCase ) {
69+ expect ( testCase . stdout ) . toBeTask ( 'webstorm' ) ;
70+ }
71+ } ) ;
72+
73+ // TODO @bholloway more test coverage on webstorm task
74+ } ) ;
75+ }
7576
7677function composeOption ( boolean ) {
7778 return function optionToInvocation ( option ) {
0 commit comments