88import { join } from 'path' ;
99import { expectFileToExist , expectFileToMatch , replaceInFile , writeFile } from '../../utils/fs' ;
1010import { ng } from '../../utils/process' ;
11- import { expectToFail } from '../../utils/utils' ;
1211
1312export default async function ( ) {
1413 const workerPath = join ( 'src' , 'app' , 'app.worker.ts' ) ;
@@ -27,23 +26,19 @@ export default async function () {
2726 await expectFileToExist ( workerPath ) ;
2827 await expectFileToExist ( projectTsConfig ) ;
2928 await expectFileToExist ( workerTsConfig ) ;
30- await expectFileToMatch ( snippetPath , `new Worker('./app.worker', { type: 'module' } )` ) ;
29+ await expectFileToMatch ( snippetPath , `new Worker(new URL( './app.worker', import.meta.url )` ) ;
3130
3231 await ng ( 'build' , '--configuration=development' ) ;
33- await expectFileToExist ( 'dist/test-project/0-es5.worker.js' ) ;
34- await expectFileToMatch ( 'dist/test-project/main-es5.js' , '0-es5.worker.js' ) ;
35- await expectToFail ( ( ) => expectFileToMatch ( 'dist/test-project/main-es5.js' , '0-es2017.worker.js' ) ) ;
36- await expectFileToExist ( 'dist/test-project/0-es2017.worker.js' ) ;
37- await expectFileToMatch ( 'dist/test-project/main-es2017.js' , '0-es2017.worker.js' ) ;
38- await expectToFail ( ( ) => expectFileToMatch ( 'dist/test-project/main-es2017.js' , '0-es5.worker.js' ) ) ;
32+ await expectFileToExist ( 'dist/test-project/src_app_app_worker_ts-es5.js' ) ;
33+ await expectFileToMatch ( 'dist/test-project/main-es5.js' , 'src_app_app_worker_ts' ) ;
34+ await expectFileToExist ( 'dist/test-project/src_app_app_worker_ts-es2017.js' ) ;
35+ await expectFileToMatch ( 'dist/test-project/main-es2017.js' , 'src_app_app_worker_ts' ) ;
3936
4037 await ng ( 'build' , '--output-hashing=none' ) ;
41- await expectFileToExist ( 'dist/test-project/0-es5.worker.js' ) ;
42- await expectFileToMatch ( 'dist/test-project/main-es5.js' , '0-es5.worker.js' ) ;
43- await expectToFail ( ( ) => expectFileToMatch ( 'dist/test-project/main-es5.js' , '0-es2017.worker.js' ) ) ;
44- await expectFileToExist ( 'dist/test-project/0-es2017.worker.js' ) ;
45- await expectFileToMatch ( 'dist/test-project/main-es2017.js' , '0-es2017.worker.js' ) ;
46- await expectToFail ( ( ) => expectFileToMatch ( 'dist/test-project/main-es2017.js' , '0-es5.worker.js' ) ) ;
38+ await expectFileToExist ( 'dist/test-project/609-es5.js' ) ;
39+ await expectFileToMatch ( 'dist/test-project/main-es5.js' , '609' ) ;
40+ await expectFileToExist ( 'dist/test-project/609-es2017.js' ) ;
41+ await expectFileToMatch ( 'dist/test-project/main-es2017.js' , '609' ) ;
4742
4843 // console.warn has to be used because chrome only captures warnings and errors by default
4944 // https://github.com/angular/protractor/issues/2207
0 commit comments