forked from angular/angular-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoutput-dir.ts
More file actions
29 lines (25 loc) · 1.15 KB
/
output-dir.ts
File metadata and controls
29 lines (25 loc) · 1.15 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
import {getGlobalVariable} from '../../utils/env';
import {expectFileToExist} from '../../utils/fs';
import {expectGitToBeClean} from '../../utils/git';
import {ng} from '../../utils/process';
import {updateJsonFile} from '../../utils/project';
import {expectToFail} from '../../utils/utils';
export default function() {
// TODO(architect): Delete this test. It is now in devkit/build-angular.
// Skip this in ejected tests.
if (getGlobalVariable('argv').eject) {
return Promise.resolve();
}
return ng('build', '--output-path', 'build-output')
.then(() => expectFileToExist('./build-output/index.html'))
.then(() => expectFileToExist('./build-output/main.js'))
.then(() => expectToFail(expectGitToBeClean))
.then(() => updateJsonFile('angular.json', workspaceJson => {
const appArchitect = workspaceJson.projects['test-project'].architect;
appArchitect.build.options.outputPath = 'config-build-output';
}))
.then(() => ng('build'))
.then(() => expectFileToExist('./config-build-output/index.html'))
.then(() => expectFileToExist('./config-build-output/main.js'))
.then(() => expectToFail(expectGitToBeClean));
}