@@ -414,6 +414,12 @@ describe('TypeScript Watch API', () => {
414
414
{ webpack : '4.0.0' , async : false , ignored : '[path.resolve(__dirname, "src/model/**")]' } ,
415
415
{ webpack : '^4.0.0' , async : true , ignored : '"**/src/model/**"' } ,
416
416
{ webpack : '^5.0.0' , async : false , ignored : '/src\\/model/' } ,
417
+ {
418
+ webpack : '^4.0.0' ,
419
+ async : true ,
420
+ ignored :
421
+ '(file) => forwardSlash(file).includes(forwardSlash(path.resolve(__dirname, "src/model/")))' ,
422
+ } ,
417
423
] ) ( 'ignores directories from watch with %p' , async ( { webpack, async, ignored } ) => {
418
424
await sandbox . load ( [
419
425
await readFixture ( join ( __dirname , 'fixtures/environment/typescript-basic.fixture' ) , {
@@ -430,6 +436,16 @@ describe('TypeScript Watch API', () => {
430
436
await readFixture ( join ( __dirname , 'fixtures/implementation/typescript-basic.fixture' ) ) ,
431
437
] ) ;
432
438
439
+ await sandbox . patch (
440
+ 'webpack.config.js' ,
441
+ 'module.exports = {' ,
442
+ [
443
+ 'function forwardSlash(input) {' ,
444
+ " return path.normalize(input).replace(/\\\\+/g, '/');" ,
445
+ '}' ,
446
+ 'module.exports = {' ,
447
+ ] . join ( '\n' )
448
+ ) ;
433
449
await sandbox . patch (
434
450
'webpack.config.js' ,
435
451
" entry: './src/index.ts'," ,
@@ -453,7 +469,11 @@ describe('TypeScript Watch API', () => {
453
469
await sandbox . write ( 'src/model/Group.ts' , '// TODO: to implement' ) ;
454
470
455
471
// there should be no re-build
456
- await expect ( driver . waitForErrors ( 3000 ) ) . rejects . toBeDefined ( ) ;
457
- await expect ( driver . waitForNoErrors ( 3000 ) ) . rejects . toBeDefined ( ) ;
472
+ await expect ( driver . waitForNoErrors ( 3000 ) ) . rejects . toEqual (
473
+ new Error ( 'Exceeded time on waiting for no errors message to appear.' )
474
+ ) ;
475
+ await expect ( driver . waitForErrors ( 3000 ) ) . rejects . toEqual (
476
+ new Error ( 'Exceeded time on waiting for errors to appear.' )
477
+ ) ;
458
478
} ) ;
459
479
} ) ;
0 commit comments