-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Expand file tree
/
Copy pathbuilder-not-found.ts
More file actions
45 lines (41 loc) · 1.42 KB
/
builder-not-found.ts
File metadata and controls
45 lines (41 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import { moveFile } from '../../utils/fs';
import { getActivePackageManager, installPackage, uninstallPackage } from '../../utils/packages';
import { execAndWaitForOutputToMatch, ng } from '../../utils/process';
import { expectToFail } from '../../utils/utils';
export default async function () {
try {
await uninstallPackage('@angular-devkit/build-angular');
await expectToFail(() => ng('build'));
await execAndWaitForOutputToMatch(
'ng',
['build'],
/Could not find the '@angular-devkit\/build-angular:browser' builder's node package\./,
);
await expectToFail(() =>
execAndWaitForOutputToMatch(
'ng',
['build'],
new RegExp(
`Node packages may not be installed\\. Try installing with '${getActivePackageManager()} install'\\.`,
),
),
);
await moveFile('node_modules', 'temp_node_modules');
await expectToFail(() => ng('build'));
await execAndWaitForOutputToMatch(
'ng',
['build'],
/Could not find the '@angular-devkit\/build-angular:browser' builder's node package\./,
);
await execAndWaitForOutputToMatch(
'ng',
['build'],
new RegExp(
`Node packages may not be installed\\. Try installing with '${getActivePackageManager()} install'\\.`,
),
);
} finally {
await moveFile('temp_node_modules', 'node_modules');
await installPackage('@angular-devkit/build-angular');
}
}