@@ -21,6 +21,8 @@ export default class Configure extends BaseCommand {
21
21
public static description = 'Configure one or more AdonisJS packages'
22
22
public static aliases = [ 'invoke' ]
23
23
24
+ private appType = process . env [ 'ADONIS_CREATE_APP_BOILERPLATE' ] || 'web'
25
+
24
26
/**
25
27
* Use yarn when building for production to install dependencies
26
28
*/
@@ -110,7 +112,7 @@ export default class Configure extends BaseCommand {
110
112
const helloWorldTestFile = new files . MustacheFile (
111
113
this . application . appRoot ,
112
114
'tests/functional/hello_world.spec.ts' ,
113
- join ( __dirname , '..' , ' templates/tests/functional/hello_world. spec.txt' )
115
+ join ( __dirname , '..' , ` templates/tests/functional/hello_world_ ${ this . appType } . spec.txt` )
114
116
)
115
117
if ( ! helloWorldTestFile . exists ( ) ) {
116
118
helloWorldTestFile . apply ( { } ) . commit ( )
@@ -147,6 +149,23 @@ export default class Configure extends BaseCommand {
147
149
rcFile . commit ( )
148
150
logger . action ( 'update' ) . succeeded ( '.adonisrc.json' )
149
151
152
+ /**
153
+ * Create ".env.test" file
154
+ */
155
+ const testEnvFile = new files . NewLineFile ( this . application . appRoot , '.env.test' )
156
+ if ( ! testEnvFile . exists ( ) ) {
157
+ testEnvFile . add ( 'NODE_ENV=test' )
158
+
159
+ /**
160
+ * Set additional .env variables for "web" boilerplate
161
+ */
162
+ if ( this . appType === 'web' ) {
163
+ testEnvFile . add ( [ 'ASSETS_DRIVER=fake' , 'SESSION_DRIVER=memory' ] )
164
+ }
165
+
166
+ logger . action ( 'create' ) . succeeded ( '.env.test' )
167
+ }
168
+
150
169
/**
151
170
* Install required dependencies
152
171
*/
0 commit comments