Skip to content

Commit 3cafabc

Browse files
test(#847): Update tests to use assert.throws and ensure done() is called
1 parent 4df42f6 commit 3cafabc

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

test/test_eoc.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,11 @@ describe('eoc', () => {
3434
describe('eoc', () => {
3535
before(weAreOnline);
3636
it('fails due version mismatch if different --pin provided', (done) => {
37-
const stdout = runSync(['--pin=29.9.4', 'clean']);
38-
assert(stdout.includes("Version mismatch: you are running eoc 0.0.0, but --pin option requires 29.9.4"));
37+
assert.throws(
38+
() => { runSync(['--pin=29.9.4', 'clean']); },
39+
/Version mismatch: you are running eoc 0.0.0, but --pin option requires 29.9.4/
40+
);
41+
done();
3942
});
4043
});
4144

@@ -44,6 +47,7 @@ describe('eoc', () => {
4447
it('cleans successfully when versions match with --pin', (done) => {
4548
const stdout = runSync(['--pin=0.0.0', 'clean']);
4649
assert(stdout.includes("The directory .eoc does not exist, no need to delete it"));
50+
done();
4751
});
4852
});
4953

@@ -52,5 +56,6 @@ describe('eoc', () => {
5256
it('cleans successfully when if --pin not provided', (done) => {
5357
const stdout = runSync(['clean']);
5458
assert(stdout.includes("The directory .eoc does not exist, no need to delete it"));
59+
done();
5560
});
5661
});

0 commit comments

Comments
 (0)