Skip to content

Commit

Permalink
apply code reviews
Browse files Browse the repository at this point in the history
Signed-off-by: Outsider <outsideris@gmail.com>
  • Loading branch information
outsideris committed Apr 25, 2021
1 parent c718c0e commit b6b4eef
Showing 1 changed file with 14 additions and 22 deletions.
36 changes: 14 additions & 22 deletions test/integration/options/watch.spec.js
Expand Up @@ -47,21 +47,17 @@ describe('--watch', function() {
});
});

it('reruns test when watched test file is crashed', function() {
it('reruns test when watched test file crashes', function() {
const testFile = path.join(tempDir, 'test.js');
copyFixture(DEFAULT_FIXTURE, testFile);

replaceFileContents(testFile, 'done();', 'done((;');

return runMochaWatchJSONAsync([testFile], tempDir, () => {
replaceFileContents(testFile, 'done();', 'done((;');
})
.then(() => {
return runMochaWatchJSONAsync([testFile], tempDir, () => {
replaceFileContents(testFile, 'done((;', 'done();');
});
})
.then(results => {
expect(results, 'to have length', 1);
});
replaceFileContents(testFile, 'done((;', 'done();');
}).then(results => {
expect(results, 'to have length', 1);
});
});

describe('when in parallel mode', function() {
Expand All @@ -80,17 +76,13 @@ describe('--watch', function() {
const testFile = path.join(tempDir, 'test.js');
copyFixture(DEFAULT_FIXTURE, testFile);

return runMochaWatchJSONAsync(['--parallel', testFile], tempDir, () => {
replaceFileContents(testFile, 'done();', 'done((;');
})
.then(() => {
return runMochaWatchJSONAsync([testFile], tempDir, () => {
replaceFileContents(testFile, 'done((;', 'done();');
});
})
.then(results => {
expect(results, 'to have length', 1);
});
replaceFileContents(testFile, 'done();', 'done((;');

return runMochaWatchJSONAsync([testFile], tempDir, () => {
replaceFileContents(testFile, 'done((;', 'done();');
}).then(results => {
expect(results, 'to have length', 1);
});
});
});

Expand Down

0 comments on commit b6b4eef

Please sign in to comment.