-
Notifications
You must be signed in to change notification settings - Fork 242
/
verify.ts
34 lines (26 loc) · 1.12 KB
/
verify.ts
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
import { promises as fsPromises } from 'fs';
import chai, { expect } from 'chai';
import chaiAsPromised from 'chai-as-promised';
chai.use(chaiAsPromised);
describe('Verify stryker has handled dry run failure correctly', () => {
let strykerLog: string;
before(async () => {
strykerLog = await fsPromises.readFile('./stryker.log', 'utf8');
});
it('should about failed tests in initial test run', async () => {
expect(strykerLog).contains('There were failed tests in the initial test run');
});
it('should log exactly which test failed and why', async () => {
expect(strykerLog)
.contains('add 1 + 1 = 3... ? (this is the test that should fail)')
.contains('expected 2 to equal 3');
});
it('should have exited with a non-zero exit code', async () => {
// This line is added in package.json script if the process exited in an error.
expect(strykerLog)
.contains('Exited with an error exit code');
});
it('should not delete the temp dir', async () => {
await expect(fsPromises.stat('.stryker-tmp'), 'Expected the `.stryker-tmp` dir to not be deleted.').not.rejected;
});
});