forked from angular/angular-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathassets.ts
More file actions
22 lines (20 loc) · 970 Bytes
/
assets.ts
File metadata and controls
22 lines (20 loc) · 970 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import {writeFile, expectFileToExist, expectFileToMatch} from '../../utils/fs';
import {ng} from '../../utils/process';
import {updateJsonFile} from '../../utils/project';
import {expectToFail} from '../../utils/utils';
export default function() {
return writeFile('src/assets/.file', '')
.then(() => writeFile('src/assets/test.abc', 'hello world'))
.then(() => ng('build'))
.then(() => expectFileToExist('dist/favicon.ico'))
.then(() => expectFileToExist('dist/assets/.file'))
.then(() => expectFileToMatch('dist/assets/test.abc', 'hello world'))
.then(() => expectToFail(() => expectFileToExist('dist/assets/.gitkeep')))
// doesn't break beta.16 projects
.then(() => updateJsonFile('angular-cli.json', configJson => {
const app = configJson['apps'][0];
app['assets'] = 'assets';
}))
.then(() => expectFileToExist('dist/assets/.file'))
.then(() => expectFileToMatch('dist/assets/test.abc', 'hello world'));
}