@@ -4,6 +4,7 @@ import * as fs from 'fs-extra';
4
4
import * as os from 'os' ;
5
5
import * as pty from 'node-pty' ;
6
6
import { nspawn as spawn } from '@aws-amplify/amplify-e2e-core' ;
7
+ jest . retryTimes ( 0 ) ;
7
8
8
9
export const NPM = {
9
10
install ( pkgName : string , isGlobal : boolean = false ) : Promise < void > {
@@ -141,13 +142,14 @@ export class Amplify {
141
142
. runAsync ( ) ;
142
143
} ;
143
144
addRestApi = ( ) => {
144
- return spawn ( 'amplify' , [ 'add' , 'api' ] , this . executionArgs )
145
+ return spawn ( 'amplify' , [ 'add' , 'api' ] , { ... this . executionArgs , noOutputTimeout : 3000 } )
145
146
. wait ( 'Select from one of the below mentioned services' )
146
147
. sendKeyDown ( )
147
148
. sendCarriageReturn ( )
148
149
. wait ( 'Provide a friendly name' )
150
+ . delay ( 500 )
149
151
. sendCarriageReturn ( )
150
- . wait ( 'Provide a path (e.g. /book/{isbn}): ' )
152
+ . wait ( 'Provide a path' )
151
153
. sendCarriageReturn ( )
152
154
. wait ( 'Choose a Lambda source' )
153
155
. sendCarriageReturn ( )
@@ -158,13 +160,14 @@ export class Amplify {
158
160
. wait ( 'Choose the function template that you want to use:' )
159
161
. sendCarriageReturn ( )
160
162
. wait ( 'Do you want to configure advanced settings?' )
161
- . sendNo ( )
163
+ . sendLine ( 'n' )
162
164
. wait ( 'Do you want to edit the local lambda function now?' )
163
- . sendNo ( )
165
+ . sendLine ( 'n' )
164
166
. wait ( 'Restrict API access?' )
165
- . sendCarriageReturn ( )
167
+ . sendLine ( 'n' )
166
168
. wait ( 'Do you want to add another path?' )
167
169
. sendNo ( )
170
+
168
171
. runAsync ( ) ;
169
172
} ;
170
173
status = ( ) => {
@@ -175,7 +178,6 @@ export class Amplify {
175
178
const [ apiName ] = fs . readdirSync ( path . join ( this . executionArgs . cwd , 'amplify' , 'backend' , 'api' ) ) ;
176
179
const targetPath = path . join ( this . executionArgs . cwd , 'amplify' , 'backend' , 'api' , apiName , 'schema.graphql' ) ;
177
180
fs . writeFileSync ( targetPath , schema ) ;
178
- console . info ( 'Wrote to' , targetPath ) ;
179
181
return Promise . resolve ( 0 ) ;
180
182
} catch ( e ) {
181
183
return Promise . reject ( 1 ) ;
@@ -203,7 +205,7 @@ type Todo @model {
203
205
function writeBanner ( text : string ) {
204
206
const count = text . length ;
205
207
const textPadding = 3 ;
206
- console . log ( '\n' ) ;
208
+ process . stdout . write ( '\n' ) ;
207
209
process . stdout . write ( '#' . repeat ( count + 2 + textPadding * 2 ) ) ;
208
210
process . stdout . write ( '\n' ) ;
209
211
process . stdout . write ( `#${ ' ' . repeat ( count + textPadding * 2 ) } #` ) ;
@@ -282,7 +284,6 @@ describe('Release Smoke Tests', () => {
282
284
] ;
283
285
test ( 'An amplify project can be created without error' , async ( ) => {
284
286
const args = getArgs ( ) ;
285
- console . info ( args . projectDirectory ) ;
286
287
287
288
const amplify = new Amplify ( args . projectDirectory ) ;
288
289
createProjectDirectory ( args . projectDirectory ) ;
@@ -297,6 +298,5 @@ describe('Release Smoke Tests', () => {
297
298
writeBanner ( command . description ) ;
298
299
await command . run ( ) ;
299
300
}
300
- expect . assertions ( 0 ) ;
301
301
} ) ;
302
302
} ) ;
0 commit comments