diff --git a/tests/lib/linter/code-path-analysis/code-path-analyzer.js b/tests/lib/linter/code-path-analysis/code-path-analyzer.js index dbed9b46194..d6a559fdb65 100644 --- a/tests/lib/linter/code-path-analysis/code-path-analyzer.js +++ b/tests/lib/linter/code-path-analysis/code-path-analyzer.js @@ -31,7 +31,7 @@ const STANDARD_ESQUERY_OPTION = { visitorKeys: vk.KEYS, fallback: Traverser.getK const expectedPattern = /\/\*expected\s+((?:.|[\r\n])+?)\s*\*\//gu; const lineEndingPattern = /\r?\n/gu; -const linter = new Linter(); +const linter = new Linter({ configType: "eslintrc" }); /** * Extracts the content of `/*expected` comments from a given source code. diff --git a/tests/lib/linter/code-path-analysis/code-path.js b/tests/lib/linter/code-path-analysis/code-path.js index 7f1d738f6e9..0864efa822e 100644 --- a/tests/lib/linter/code-path-analysis/code-path.js +++ b/tests/lib/linter/code-path-analysis/code-path.js @@ -11,7 +11,7 @@ const assert = require("assert"), { Linter } = require("../../../../lib/linter"); -const linter = new Linter(); +const linter = new Linter({ configType: "eslintrc" }); //------------------------------------------------------------------------------ // Helpers diff --git a/tests/lib/linter/rules.js b/tests/lib/linter/rules.js index 31d6764dc26..7ae12289842 100644 --- a/tests/lib/linter/rules.js +++ b/tests/lib/linter/rules.js @@ -58,30 +58,19 @@ describe("rules", () => { const linter = new Linter(); - const problems = linter.verify("foo", { rules: { "test-rule": "error" } }); - - assert.lengthOf(problems, 1); - assert.strictEqual(problems[0].message, "Definition for rule 'test-rule' was not found."); - assert.strictEqual(problems[0].line, 1); - assert.strictEqual(problems[0].column, 1); - assert.strictEqual(problems[0].endLine, 1); - assert.strictEqual(problems[0].endColumn, 2); + assert.throws(() => { + linter.verify("foo", { rules: { "test-rule": "error" } }); + }, TypeError, "Could not find \"test-rule\" in plugin \"@\"."); + }); it("should report a linting error that lists replacements if a rule is known to have been replaced", () => { const linter = new Linter(); - const problems = linter.verify("foo", { rules: { "no-arrow-condition": "error" } }); - - assert.lengthOf(problems, 1); - assert.strictEqual( - problems[0].message, - "Rule 'no-arrow-condition' was removed and replaced by: no-confusing-arrow, no-constant-condition" - ); - assert.strictEqual(problems[0].line, 1); - assert.strictEqual(problems[0].column, 1); - assert.strictEqual(problems[0].endLine, 1); - assert.strictEqual(problems[0].endColumn, 2); + + assert.throws(() => { + linter.verify("foo", { rules: { "no-arrow-condition": "error" } }); + }, TypeError, "Key \"rules\": Key \"no-arrow-condition\": Rule \"no-arrow-condition\" was removed and replaced by \"no-confusing-arrow,no-constant-condition\"."); }); }); diff --git a/tests/lib/rules/utils/ast-utils.js b/tests/lib/rules/utils/ast-utils.js index bc03c7e47cd..6684df35f00 100644 --- a/tests/lib/rules/utils/ast-utils.js +++ b/tests/lib/rules/utils/ast-utils.js @@ -27,7 +27,7 @@ const ESPREE_CONFIG = { range: true, loc: true }; -const linter = new Linter(); +const linter = new Linter({ configType: "eslintrc" }); describe("ast-utils", () => { let callCounts; diff --git a/tests/lib/shared/config-validator.js b/tests/lib/shared/config-validator.js index d54d26e360d..5788824b929 100644 --- a/tests/lib/shared/config-validator.js +++ b/tests/lib/shared/config-validator.js @@ -30,7 +30,7 @@ const assert = require("chai").assert, // Helpers //------------------------------------------------------------------------------ -const linter = new Linter(); +const linter = new Linter({ configType: "eslintrc" }); const mockRule = { meta: {