-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Expand file tree
/
Copy pathkarma-junit-output.ts
More file actions
27 lines (21 loc) · 902 Bytes
/
karma-junit-output.ts
File metadata and controls
27 lines (21 loc) · 902 Bytes
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
import { expectFileMatchToExist, replaceInFile } from '../../utils/fs';
import { installPackage } from '../../utils/packages';
import { silentNg } from '../../utils/process';
const E2E_CUSTOM_LAUNCHER = `
customLaunchers: {
ChromeHeadlessNoSandbox: {
base: 'ChromeHeadless',
flags: ['--no-sandbox', '--headless', '--disable-gpu', '--disable-dev-shm-usage'],
},
},
restartOnFileChange: true
`;
export default async function () {
await installPackage('karma-junit-reporter');
await silentNg('generate', 'config', 'karma');
await replaceInFile('karma.conf.js', 'karma-jasmine-html-reporter', 'karma-junit-reporter');
await replaceInFile('karma.conf.js', `'kjhtml'`, `'junit'`);
await replaceInFile('karma.conf.js', `restartOnFileChange: true`, E2E_CUSTOM_LAUNCHER);
await silentNg('test', '--no-watch');
await expectFileMatchToExist('.', /TESTS\-.+\.xml/);
}