8
8
import { join } from 'path' ;
9
9
import { expectFileToExist , expectFileToMatch , replaceInFile , writeFile } from '../../utils/fs' ;
10
10
import { ng } from '../../utils/process' ;
11
- import { expectToFail } from '../../utils/utils' ;
12
11
13
12
export default async function ( ) {
14
13
const workerPath = join ( 'src' , 'app' , 'app.worker.ts' ) ;
@@ -27,23 +26,19 @@ export default async function () {
27
26
await expectFileToExist ( workerPath ) ;
28
27
await expectFileToExist ( projectTsConfig ) ;
29
28
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 )` ) ;
31
30
32
31
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' ) ;
39
36
40
37
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' ) ;
47
42
48
43
// console.warn has to be used because chrome only captures warnings and errors by default
49
44
// https://github.com/angular/protractor/issues/2207
0 commit comments