forked from angular/angular-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcoverage.ts
More file actions
28 lines (25 loc) · 1.23 KB
/
coverage.ts
File metadata and controls
28 lines (25 loc) · 1.23 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
import {expectFileToExist, expectFileToMatch} from '../../utils/fs';
import {updateJsonFile} from '../../utils/project';
import {expectToFail} from '../../utils/utils';
import {ng} from '../../utils/process';
export default function () {
// TODO(architect): This test is broken in devkit/build-angular, istanbul and
// istanbul-instrumenter-loader are missing from the dependencies.
return;
return ng('test', '--watch=false', '--code-coverage')
.then(() => expectFileToExist('coverage/src/app'))
.then(() => expectFileToExist('coverage/lcov.info'))
// Verify code coverage exclude work
.then(() => expectFileToMatch('coverage/lcov.info', 'polyfills.ts'))
.then(() => expectFileToMatch('coverage/lcov.info', 'test.ts'))
.then(() => updateJsonFile('angular.json', workspaceJson => {
const appArchitect = workspaceJson.projects['test-project'].architect;
appArchitect.test.options.codeCoverageExclude = [
'src/polyfills.ts',
'**/test.ts'
];
}))
.then(() => ng('test', '--watch=false', '--code-coverage'))
.then(() => expectToFail(() => expectFileToMatch('coverage/lcov.info', 'polyfills.ts')))
.then(() => expectToFail(() => expectFileToMatch('coverage/lcov.info', 'test.ts')));
}