|
1 | 1 | import { oneLineTrim } from 'common-tags';
|
2 | 2 | import {
|
| 3 | + appendToFile, |
3 | 4 | expectFileSizeToBeUnder,
|
4 | 5 | expectFileToExist,
|
5 | 6 | expectFileToMatch,
|
6 | 7 | getFileSize,
|
7 |
| - replaceInFile, |
8 | 8 | } from '../../utils/fs';
|
9 | 9 | import { ng } from '../../utils/process';
|
10 | 10 | import { expectToFail } from '../../utils/utils';
|
11 | 11 |
|
12 | 12 | export default async function () {
|
13 | 13 | // Enable Differential loading to run both size checks
|
14 |
| - await replaceInFile( |
15 |
| - '.browserslistrc', |
16 |
| - 'not IE 11', |
17 |
| - 'IE 11', |
18 |
| - ); |
| 14 | + await appendToFile('.browserslistrc', 'IE 11'); |
19 | 15 |
|
20 | 16 | await ng('build', '--aot=false', '--configuration=development');
|
21 | 17 | // files were created successfully
|
22 |
| - await expectFileToMatch('dist/test-project/polyfills-es5.js', 'core-js/proposals/reflect-metadata'); |
| 18 | + await expectFileToMatch( |
| 19 | + 'dist/test-project/polyfills-es5.js', |
| 20 | + 'core-js/proposals/reflect-metadata', |
| 21 | + ); |
23 | 22 | await expectFileToMatch('dist/test-project/polyfills-es5.js', 'zone.js');
|
24 | 23 |
|
25 |
| - await expectFileToMatch('dist/test-project/index.html', oneLineTrim` |
| 24 | + await expectFileToMatch( |
| 25 | + 'dist/test-project/index.html', |
| 26 | + oneLineTrim` |
26 | 27 | <script src="polyfills-es5.js" nomodule defer></script>
|
27 | 28 | <script src="polyfills-es2017.js" type="module">
|
28 |
| - `); |
| 29 | + `, |
| 30 | + ); |
29 | 31 |
|
30 | 32 | const jitPolyfillSize = await getFileSize('dist/test-project/polyfills-es5.js');
|
31 | 33 |
|
32 | 34 | await ng('build', '--aot=true', '--configuration=development');
|
33 | 35 | // files were created successfully
|
34 | 36 | await expectFileToExist('dist/test-project/polyfills-es5.js');
|
35 | 37 | await expectFileSizeToBeUnder('dist/test-project/polyfills-es5.js', jitPolyfillSize);
|
36 |
| - await expectToFail(() => expectFileToMatch('dist/test-project/polyfills-es5.js', 'core-js/proposals/reflect-metadata')); |
| 38 | + await expectToFail(() => |
| 39 | + expectFileToMatch('dist/test-project/polyfills-es5.js', 'core-js/proposals/reflect-metadata'), |
| 40 | + ); |
37 | 41 | await expectFileToMatch('dist/test-project/polyfills-es5.js', 'zone.js');
|
38 | 42 |
|
39 |
| - await expectFileToMatch('dist/test-project/index.html', oneLineTrim` |
| 43 | + await expectFileToMatch( |
| 44 | + 'dist/test-project/index.html', |
| 45 | + oneLineTrim` |
40 | 46 | <script src="polyfills-es5.js" nomodule defer></script>
|
41 | 47 | <script src="polyfills-es2017.js" type="module">
|
42 |
| - `); |
| 48 | + `, |
| 49 | + ); |
43 | 50 | }
|
0 commit comments