@@ -205,7 +205,7 @@ async function testInteractive(
205
205
projectName : string ,
206
206
entry : ReadonlyArray < string | ReadonlyArray < string > >
207
207
) : Promise < execa . ExecaReturns > {
208
- const lastCheck = entry [ 3 ] !== undefined ;
208
+ const typeDefs = entry [ 3 ] !== '' ;
209
209
const proc = execa ( `../bin/typescript-starter` , [ '--noinstall' ] , {
210
210
cwd : buildDir ,
211
211
env : {
@@ -247,45 +247,54 @@ async function testInteractive(
247
247
clearBuffer ( ) ;
248
248
type ( `${ entry [ 1 ] } ${ enter } ` ) ;
249
249
await ms ( 200 ) ;
250
- checkBuffer ( new RegExp ( `${ entry [ 1 ] } [\\s\\S]*npm or yarn?` ) ) ;
250
+ checkBuffer ( new RegExp ( `${ entry [ 1 ] } [\\s\\S]*npm or yarn\\ ?` ) ) ;
251
251
clearBuffer ( ) ;
252
252
type ( `${ entry [ 2 ] [ 0 ] } ${ enter } ` ) ;
253
253
await ms ( 200 ) ;
254
- const search = `${ entry [ 2 ] [ 1 ] } [\\s\\S]*global type definitions ` ;
255
- const exp = lastCheck
254
+ const search = `\\? ${ entry [ 2 ] [ 1 ] } ` ;
255
+ const exp = typeDefs
256
256
? new RegExp ( `${ search } ` ) // should match
257
257
: new RegExp ( `(?!${ search } )` ) ; // should not match
258
258
checkBuffer ( exp ) ;
259
259
// tslint:disable-next-line:no-if-statement
260
- if ( lastCheck ) {
260
+ if ( typeDefs ) {
261
261
clearBuffer ( ) ;
262
262
type ( `${ entry [ 3 ] [ 0 ] } ${ enter } ` ) ;
263
263
await ms ( 200 ) ;
264
- checkBuffer ( new RegExp ( `${ entry [ 3 ] [ 1 ] } ` ) ) ;
264
+ checkBuffer ( new RegExp ( `${ entry [ 3 ] [ 1 ] } [\\s\\S]*More fun stuff ` ) ) ;
265
265
}
266
+ clearBuffer ( ) ;
267
+ type ( `${ entry [ 4 ] [ 0 ] } ${ enter } ` ) ;
268
+ await ms ( 200 ) ;
269
+ checkBuffer ( new RegExp ( `${ entry [ 4 ] [ 1 ] } ` ) ) ;
266
270
return proc ;
267
271
}
268
272
269
273
test ( `${
270
274
TestDirectories . three
271
275
} : interactive mode: javascript library`, async t => {
272
- t . plan ( 7 ) ;
276
+ t . plan ( 8 ) ;
273
277
const proc = await testInteractive ( t , `${ TestDirectories . three } ` , [
274
278
[ `${ down } ${ up } ${ down } ` , `Javascript library` ] ,
275
279
`integration test 3 description` ,
276
280
[ `${ down } ${ up } ${ down } ${ enter } ` , `yarn` ] ,
277
- [ `${ down } ${ down } ${ down } ${ enter } ` , `Both Node.js and DOM` ]
281
+ [ `${ down } ${ down } ${ down } ${ enter } ` , `Both Node.js and DOM` ] ,
282
+ [ ' ' , 'stricter type-checking[\\s\\S]*tslint-immutable[\\s\\S]*VS Code' ]
278
283
] ) ;
279
284
await proc ;
280
285
const map = await hashAllTheThings ( TestDirectories . three ) ;
281
286
t . deepEqual ( map , {
282
287
'test-3/README.md' : 'c52631ebf78f6b030af9a109b769b647' ,
283
288
'test-3/bin/typescript-starter' : 'a4ad3923f37f50df986b43b1adb9f6b3' ,
284
- 'test-3/src/index.ts' : '5991bedc40ac87a01d880c6db16fe349' ,
289
+ 'test-3/src/index.ts' : 'fbc67c2cbf3a7d37e4e02583bf06eec9' ,
290
+ 'test-3/src/lib/async.spec.ts' : '1e83b84de3f3b068244885219acb42bd' ,
291
+ 'test-3/src/lib/async.ts' : '9012c267bb25fa98ad2561929de3d4e2' ,
292
+ 'test-3/src/lib/hash.spec.ts' : '87bfca3c0116fd86a353750fcf585ecf' ,
293
+ 'test-3/src/lib/hash.ts' : 'a4c552897f25da5963f410e375264bd1' ,
285
294
'test-3/src/lib/number.spec.ts' : '40ebb014eb7871d1f810c618aba1d589' ,
286
295
'test-3/src/lib/number.ts' : '43756f90e6ac0b1c4ee6c81d8ab969c7' ,
287
296
'test-3/src/types/example.d.ts' : '4221812f6f0434eec77ccb1fba1e3759' ,
288
- 'test-3/tsconfig.json' : 'f36dc6407fc898f41a23cb620b2f4884 ' ,
297
+ 'test-3/tsconfig.json' : '43817952d399db9e44977b3703edd7cf ' ,
289
298
'test-3/tsconfig.module.json' : '2fda4c8760c6cfa3462b40df0645850d' ,
290
299
'test-3/tslint.json' : '7ac167ffbcb724a6c270e8dc4e747067'
291
300
} ) ;
@@ -294,11 +303,13 @@ test(`${
294
303
test ( `${
295
304
TestDirectories . four
296
305
} : interactive mode: node.js application`, async t => {
297
- t . plan ( 6 ) ;
306
+ t . plan ( 7 ) ;
298
307
const proc = await testInteractive ( t , `${ TestDirectories . four } ` , [
299
308
[ `${ down } ${ up } ` , `Node.js application` ] ,
300
309
`integration test 4 description` ,
301
- [ `${ down } ${ up } ${ enter } ` , `npm` ]
310
+ [ `${ down } ${ up } ${ enter } ` , `npm` ] ,
311
+ '' ,
312
+ [ `${ down } ` , 'VS Code' ]
302
313
] ) ;
303
314
await proc ;
304
315
const map = await hashAllTheThings ( TestDirectories . four ) ;
@@ -347,10 +358,13 @@ test(`${
347
358
domDefinitions : false ,
348
359
email : 'email@example.com' ,
349
360
fullName : 'Satoshi Nakamoto' ,
361
+ immutable : true ,
350
362
install : true ,
351
363
nodeDefinitions : false ,
352
364
projectName : TestDirectories . five ,
353
- runner : Runner . Npm
365
+ runner : Runner . Npm ,
366
+ strict : true ,
367
+ vscode : false
354
368
} ;
355
369
const log = console . log ;
356
370
// tslint:disable-next-line:no-object-mutation
@@ -384,10 +398,13 @@ test(`${TestDirectories.six}: Sandboxed: yarn, no initial commit`, async t => {
384
398
domDefinitions : true ,
385
399
email : Placeholders . email ,
386
400
fullName : Placeholders . name ,
401
+ immutable : true ,
387
402
install : true ,
388
403
nodeDefinitions : true ,
389
404
projectName : TestDirectories . six ,
390
- runner : Runner . Yarn
405
+ runner : Runner . Yarn ,
406
+ strict : false ,
407
+ vscode : true
391
408
} ;
392
409
const log = console . log ;
393
410
// tslint:disable-next-line:no-object-mutation
0 commit comments