forked from angular/angular-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathminimal-config.ts
More file actions
44 lines (41 loc) · 1.33 KB
/
minimal-config.ts
File metadata and controls
44 lines (41 loc) · 1.33 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
import { writeFile, writeMultipleFiles } from '../../utils/fs';
import { ng } from '../../utils/process';
export default function () {
return Promise.resolve()
.then(() => writeFile('angular-cli.json', JSON.stringify({
apps: [{
root: 'src',
main: 'main.ts',
scripts: [
'../node_modules/core-js/client/shim.min.js',
'../node_modules/zone.js/dist/zone.js'
]
}],
e2e: { protractor: { config: './protractor.conf.js' } }
})))
.then(() => ng('e2e'))
.then(() => writeMultipleFiles({
'./src/script.js': `
document.querySelector('app-root').innerHTML = '<h1>app works!</h1>';
`,
'./e2e/app.e2e-spec.ts': `
import { browser, element, by } from 'protractor';
describe('minimal project App', function() {
it('should display message saying app works', () => {
browser.ignoreSynchronization = true;
browser.get('/');
let el = element(by.css('app-root h1')).getText();
expect(el).toEqual('app works!');
});
});
`,
'angular-cli.json': JSON.stringify({
apps: [{
root: 'src',
scripts: ['./script.js']
}],
e2e: { protractor: { config: './protractor.conf.js' } }
}),
}))
.then(() => ng('e2e'));
}