You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This code does not trigger the mocha/no-exports rule. It appears this is happening because the isMochaFunctionCall function in lib/util/ast.js thinks the calls to describe() and it() are shadowed references, and therefore doesn't mark them as mocha function calls. Any rule relying on this to detect mocha test files (such as mocha/no-exports) therefore does not work correctly.
import { describe, it } from "mocha";
import { assert } from "chai";
export const rx = 43;
describe("dummy test suite", function () {
it("dummy test", function () {
assert.throws(() => {
throw new Error("y");
});
});
});
export const x = 42;
The text was updated successfully, but these errors were encountered:
This code does not trigger the
mocha/no-exports
rule. It appears this is happening because theisMochaFunctionCall
function inlib/util/ast.js
thinks the calls todescribe()
andit()
are shadowed references, and therefore doesn't mark them as mocha function calls. Any rule relying on this to detect mocha test files (such asmocha/no-exports
) therefore does not work correctly.The text was updated successfully, but these errors were encountered: