Skip to content

Commit

Permalink
chore: fixed some async tests in config-lerna-scopes
Browse files Browse the repository at this point in the history
  • Loading branch information
backflip committed Aug 14, 2018
1 parent c4b49a1 commit 3516794
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions @commitlint/config-lerna-scopes/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ test('scope-enum is function', t => {

test('scope-enum does not throw for missing context', async t => {
const {'scope-enum': fn} = config.rules;
await t.notThrows(async () => fn());
try {
await fn();
t.pass();
} catch (err) {
t.fail();
}
});

test('scope-enum has expected severity', async t => {
Expand Down Expand Up @@ -55,7 +60,12 @@ test.failing(
async t => {
const {'scope-enum': fn} = config.rules;
const cwd = await npm.bootstrap('fixtures/version-mismatch');
await t.throws(async () => fn({cwd}));
try {
await fn({cwd});
t.fail();
} catch (err) {
t.pass();
}
}
);

Expand Down

0 comments on commit 3516794

Please sign in to comment.