Skip to content

Commit

Permalink
[squash]add try/finally block
Browse files Browse the repository at this point in the history
  • Loading branch information
starkwang committed Dec 26, 2017
1 parent 7252351 commit a3f60f0
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions tests/lib/testers/no-test-runners.js
Expand Up @@ -14,18 +14,22 @@ const tmpDescribe = describe;
it = null;
describe = null;

const ruleTester = new RuleTester();
try {
const ruleTester = new RuleTester();

assert.throws(() => {
ruleTester.run("no-var", require("../../fixtures/testers/rule-tester/no-var"), {
valid: [
"bar = baz;"
],
invalid: [
{ code: "var foo = bar;", output: "invalid output", errors: 1 }
]
});
}, /' foo = bar;' == 'invalid output'/);

it = tmpIt;
describe = tmpDescribe;
assert.throws(() => {
ruleTester.run("no-var", require("../../fixtures/testers/rule-tester/no-var"), {
valid: [
"bar = baz;"
],
invalid: [
{ code: "var foo = bar;", output: "invalid output", errors: 1 }
]
});
}, /' foo = bar;' == 'invalid output'/);
} catch (e) {
throw e;
} finally {
it = tmpIt;
describe = tmpDescribe;
}

0 comments on commit a3f60f0

Please sign in to comment.