1- require ( ' colors' ) ;
2- const path = require ( ' path' ) ;
3- const spawn = require ( ' cross-spawn' ) ;
4- const rimraf = require ( ' rimraf' ) ;
5- const helpers = require ( ' yeoman-test' ) ;
6- const assert = require ( ' yeoman-assert' ) ;
1+ require ( " colors" ) ;
2+ const path = require ( " path" ) ;
3+ const spawn = require ( " cross-spawn" ) ;
4+ const rimraf = require ( " rimraf" ) ;
5+ const helpers = require ( " yeoman-test" ) ;
6+ const assert = require ( " yeoman-assert" ) ;
77
88// This may need refining to something more sensible
99const CREATE_TIMEOUT = 100000 ;
1010const CLEAN_TIMEOUT = 10000 ;
1111
12- const appName = ' SimpleTest' ;
13- const screenIndexComponentName = ' IndexComponent' ;
14- const componentClassName = ' ComponentClass' ;
15- const componentStatelessName = ' ComponentStateless' ;
16- const reducerName = ' SimpleReducer' ;
12+ const appName = " SimpleTest" ;
13+ const screenIndexComponentName = " IndexComponent" ;
14+ const componentClassName = " ComponentClass" ;
15+ const componentStatelessName = " ComponentStateless" ;
16+ const reducerName = " SimpleReducer" ;
1717
1818function createProject ( ) {
19-
20- console . log ( `Creating a React Native project:` . yellow , `react-native init ${ appName } ` . green ) ;
19+ console . log (
20+ `Creating a React Native project:` . yellow ,
21+ `react-native init ${ appName } ` . green
22+ ) ;
2123 console . log ( "" ) ;
2224
23- spawn . sync ( ' react-native' , [ ' init' , appName ] , {
25+ spawn . sync ( " react-native" , [ " init" , appName ] , {
2426 cwd : __dirname ,
25- stdio : ' inherit' ,
27+ stdio : " inherit" ,
2628 } ) ;
2729
2830 console . log ( "" ) ;
@@ -32,143 +34,141 @@ function createProject() {
3234
3335createProject ( ) ;
3436
35- describe ( 'Romulus Test' , ( ) => {
36-
37+ describe ( "Romulus Test" , ( ) => {
3738 // No fat arrows here, as we want to override the timeout
3839 after ( function ( done ) {
3940 this . timeout ( CLEAN_TIMEOUT ) ;
4041
41- rimraf (
42- path . join ( __dirname , appName ) , ( ) => {
43-
44- console . log ( "" ) ;
45- console . log ( `✅ Clean up complete!` . green ) ;
46- console . log ( "" ) ;
42+ rimraf ( path . join ( __dirname , appName ) , ( ) => {
43+ console . log ( "" ) ;
44+ console . log ( `✅ Clean up complete!` . green ) ;
45+ console . log ( "" ) ;
4746
48- done ( ) ;
49- }
50- ) ;
47+ done ( ) ;
48+ } ) ;
5149 } ) ;
5250
5351 // No fat arrows here, as we want to override the timeout
54- it ( ' installs the base project files' , function ( ) {
52+ it ( " installs the base project files" , function ( ) {
5553 this . timeout ( CREATE_TIMEOUT ) ;
5654
5755 return helpers
58- . run ( path . join ( __dirname , ' ../generators/base' ) )
56+ . run ( path . join ( __dirname , " ../generators/base" ) )
5957 . cd ( path . join ( __dirname , appName ) )
6058 . withOptions ( { skipInstall : false } )
6159 . withPrompts ( {
6260 appName,
6361 i18nSupport : false ,
64- } ) . then ( ( ) => {
62+ } )
63+ . then ( ( ) => {
6564 assert . file ( [
66- ' .env' ,
67- ' .env.production' ,
68- ' .env.staging' ,
69- ' README.md' ,
70- ' bin/bump-ios.sh' ,
71- ' App/index.tsx' ,
72- ' App/Router.ts' ,
73- ' App/Screens/index.ts' ,
74- ' App/Screens/Main.tsx' ,
75- ' App/Screens/Styleguide.tsx' ,
76- ' App/Components/App/index.tsx' ,
77- ' App/Components/Button/index.tsx' ,
78- ' App/Components/Button/styles.ts' ,
79- ' App/Components/Layout/index.tsx' ,
80- ' App/Components/Layout/styles.ts' ,
81- ' App/Components/Text/index.tsx' ,
82- ' App/Components/Text/styles.ts' ,
83- ' App/Components/Utilities/Environment/index.tsx' ,
84- ' App/Components/Utilities/Environment/styles.ts' ,
85- ' App/Store/index.ts' ,
86- ' App/Store/Middleware/Buffer.ts' ,
87- ' App/Store/Middleware/index.ts' ,
88- ' App/Store/Middleware/Saga.ts' ,
89- ' App/Store/Middleware/Logger.ts' ,
90- ' App/Reducers/App.ts' ,
91- ' App/Reducers/index.ts' ,
92- ' App/Actions/App.ts' ,
93- ' App/Actions/index.ts' ,
94- ' App/Sagas/index.ts' ,
95- ' App/Sagas/RequestExample.ts' ,
96- ' App/Services/API/index.ts' ,
97- ' App/Services/API/logging.ts' ,
98- ' App/Helpers/Log.ts' ,
99- ' App/Config/index.ts' ,
100- ' App/Theme.ts' ,
101- ' App/Assets/AppIcon.png' ,
102- ' @types/index.d.ts' ,
65+ " .env" ,
66+ " .env.production" ,
67+ " .env.staging" ,
68+ " README.md" ,
69+ " bin/bump-ios.sh" ,
70+ " App/index.tsx" ,
71+ " App/Router.tsx" ,
72+ " App/Screens/index.ts" ,
73+ " App/Screens/Main.tsx" ,
74+ " App/Screens/Styleguide.tsx" ,
75+ " App/Components/App/index.tsx" ,
76+ " App/Components/Button/index.tsx" ,
77+ " App/Components/Button/styles.ts" ,
78+ " App/Components/Layout/index.tsx" ,
79+ " App/Components/Layout/styles.ts" ,
80+ " App/Components/Text/index.tsx" ,
81+ " App/Components/Text/styles.ts" ,
82+ " App/Components/Utilities/Environment/index.tsx" ,
83+ " App/Components/Utilities/Environment/styles.ts" ,
84+ " App/Store/index.ts" ,
85+ " App/Store/Middleware/Buffer.ts" ,
86+ " App/Store/Middleware/index.ts" ,
87+ " App/Store/Middleware/Saga.ts" ,
88+ " App/Store/Middleware/Logger.ts" ,
89+ " App/Reducers/App.ts" ,
90+ " App/Reducers/index.ts" ,
91+ " App/Actions/App.ts" ,
92+ " App/Actions/index.ts" ,
93+ " App/Sagas/index.ts" ,
94+ " App/Sagas/RequestExample.ts" ,
95+ " App/Services/API/index.ts" ,
96+ " App/Services/API/logging.ts" ,
97+ " App/Helpers/Log.ts" ,
98+ " App/Config/index.ts" ,
99+ " App/Theme.ts" ,
100+ " App/Assets/AppIcon.png" ,
101+ " @types/index.d.ts" ,
103102 ] ) ;
104103 } ) ;
105104 } ) ;
106105
107- it ( ' creates a screen' , ( ) => {
106+ it ( " creates a screen" , ( ) => {
108107 return helpers
109- . run ( path . join ( __dirname , ' ../generators/screen' ) )
108+ . run ( path . join ( __dirname , " ../generators/screen" ) )
110109 . cd ( path . join ( __dirname , appName ) )
111110 . withOptions ( { skipInstall : false } )
112111 . withArguments ( [ screenIndexComponentName ] )
113112 . then ( ( ) => {
114- assert . file ( [
115- `App/Screens/${ screenIndexComponentName } .tsx`
116- ] ) ;
113+ assert . file ( [ `App/Screens/${ screenIndexComponentName } .tsx` ] ) ;
117114 } ) ;
118115 } ) ;
119116
120- it ( ' creates a class based component with a given name' , ( ) => {
117+ it ( " creates a class based component with a given name" , ( ) => {
121118 return helpers
122- . run ( path . join ( __dirname , ' ../generators/component' ) )
119+ . run ( path . join ( __dirname , " ../generators/component" ) )
123120 . cd ( path . join ( __dirname , appName ) )
124121 . withOptions ( {
125122 skipInstall : false ,
126- classComponent : true
123+ classComponent : true ,
127124 } )
128125 . withArguments ( [ componentClassName ] )
129126 . withPrompts ( {
130- appName
131- } ) . then ( ( ) => {
127+ appName,
128+ } )
129+ . then ( ( ) => {
132130 assert . file ( [
133131 `App/Components/${ componentClassName } /index.tsx` ,
134132 `App/Components/${ componentClassName } /index.test.tsx` ,
135- `App/Components/${ componentClassName } /styles.ts`
133+ `App/Components/${ componentClassName } /styles.ts` ,
136134 ] ) ;
137135 } ) ;
138136 } ) ;
139137
140- it ( ' creates a stateless component with a given name' , ( ) => {
138+ it ( " creates a stateless component with a given name" , ( ) => {
141139 return helpers
142- . run ( path . join ( __dirname , ' ../generators/component' ) )
140+ . run ( path . join ( __dirname , " ../generators/component" ) )
143141 . cd ( path . join ( __dirname , appName ) )
144142 . withOptions ( { skipInstall : false } )
145143 . withArguments ( [ componentStatelessName ] )
146144 . withPrompts ( {
147- appName
148- } ) . then ( ( ) => {
145+ appName,
146+ } )
147+ . then ( ( ) => {
149148 assert . file ( [
150149 `App/Components/${ componentStatelessName } /index.tsx` ,
151150 `App/Components/${ componentStatelessName } /index.test.tsx` ,
152- `App/Components/${ componentStatelessName } /styles.ts`
151+ `App/Components/${ componentStatelessName } /styles.ts` ,
153152 ] ) ;
154- } ) ; ;
153+ } ) ;
155154 } ) ;
156155
157- it ( ' creates a reducer with a given name' , ( ) => {
156+ it ( " creates a reducer with a given name" , ( ) => {
158157 return helpers
159- . run ( path . join ( __dirname , ' ../generators/reducer' ) )
158+ . run ( path . join ( __dirname , " ../generators/reducer" ) )
160159 . cd ( path . join ( __dirname , appName ) )
161160 . withOptions ( { skipInstall : false } )
162161 . withArguments ( [ reducerName ] )
163162 . withPrompts ( {
164- appName
165- } ) . then ( ( ) => {
163+ appName,
164+ } )
165+ . then ( ( ) => {
166166 assert . file ( [
167167 `App/Reducers/${ reducerName } .ts` ,
168168 `App/Reducers/${ reducerName } .test.ts` ,
169169 `App/Actions/${ reducerName } .ts` ,
170170 `App/Actions/${ reducerName } .test.ts` ,
171171 ] ) ;
172- } ) ; ;
172+ } ) ;
173173 } ) ;
174- } )
174+ } ) ;
0 commit comments