|
1 |
| -import {join} from 'path'; |
2 |
| -import {expectFileToExist} from '../../utils/fs'; |
3 |
| -import {expectToFail} from '../../utils/utils'; |
4 |
| -import {ng} from '../../utils/process'; |
| 1 | +import { expectFileToExist, expectFileToMatch } from '../../utils/fs'; |
| 2 | +import { ng } from '../../utils/process'; |
| 3 | +import { expectToFail } from '../../utils/utils'; |
5 | 4 |
|
6 |
| -export default function() { |
7 |
| - // TODO(architect): Delete this test. It is now in devkit/build-angular. |
| 5 | +export default async function() { |
| 6 | + // Licenses should be left intact if extraction is disabled |
| 7 | + await ng('build', '--prod', '--extract-licenses=false', '--output-hashing=none'); |
8 | 8 |
|
9 |
| - return ng('build', '--prod', '--extract-licenses=false') |
10 |
| - .then(() => expectFileToExist(join(process.cwd(), 'dist'))) |
11 |
| - .then(() => expectToFail(() => expectFileToExist('dist/test-project/3rdpartylicenses.txt'))); |
| 9 | + await expectToFail(() => expectFileToExist('dist/test-project/3rdpartylicenses.txt')); |
| 10 | + await expectFileToMatch('dist/test-project/main-es2015.js', '@license'); |
| 11 | + await expectFileToMatch('dist/test-project/main-es5.js', '@license'); |
| 12 | + |
| 13 | + // Licenses should be removed if extraction is enabled |
| 14 | + await ng('build', '--prod', '--extract-licenses', '--output-hashing=none'); |
| 15 | + |
| 16 | + await expectFileToExist('dist/test-project/3rdpartylicenses.txt'); |
| 17 | + await expectToFail(() => expectFileToMatch('dist/test-project/main-es2015.js', '@license')); |
| 18 | + await expectToFail(() => expectFileToMatch('dist/test-project/main-es5.js', '@license')); |
12 | 19 | }
|
0 commit comments