|
9 | 9 | // Requirements |
10 | 10 | //------------------------------------------------------------------------------ |
11 | 11 |
|
12 | | -const assert = require("chai").assert, |
| 12 | +const { assert } = require("chai"), |
13 | 13 | sinon = require("sinon"), |
14 | 14 | espree = require("espree"), |
15 | 15 | esprima = require("esprima"), |
@@ -7263,12 +7263,12 @@ var a = "test2"; |
7263 | 7263 |
|
7264 | 7264 | it("should have file path passed to it", () => { |
7265 | 7265 | const code = "/* this is code */"; |
7266 | | - const parseSpy = sinon.spy(testParsers.stubParser, "parse"); |
| 7266 | + const parseSpy = { parse: sinon.spy() }; |
7267 | 7267 |
|
7268 | | - linter.defineParser("stub-parser", testParsers.stubParser); |
| 7268 | + linter.defineParser("stub-parser", parseSpy); |
7269 | 7269 | linter.verify(code, { parser: "stub-parser" }, filename, true); |
7270 | 7270 |
|
7271 | | - sinon.assert.calledWithMatch(parseSpy, "", { filePath: filename }); |
| 7271 | + sinon.assert.calledWithMatch(parseSpy.parse, "", { filePath: filename }); |
7272 | 7272 | }); |
7273 | 7273 |
|
7274 | 7274 | it("should not report an error when JSX code contains a spread operator and JSX is enabled", () => { |
@@ -8068,16 +8068,16 @@ describe("Linter with FlatConfigArray", () => { |
8068 | 8068 |
|
8069 | 8069 | it("should have file path passed to it", () => { |
8070 | 8070 | const code = "/* this is code */"; |
8071 | | - const parseSpy = sinon.spy(testParsers.stubParser, "parse"); |
| 8071 | + const parseSpy = { parse: sinon.spy() }; |
8072 | 8072 | const config = { |
8073 | 8073 | languageOptions: { |
8074 | | - parser: testParsers.stubParser |
| 8074 | + parser: parseSpy |
8075 | 8075 | } |
8076 | 8076 | }; |
8077 | 8077 |
|
8078 | 8078 | linter.verify(code, config, filename, true); |
8079 | 8079 |
|
8080 | | - sinon.assert.calledWithMatch(parseSpy, "", { filePath: filename }); |
| 8080 | + sinon.assert.calledWithMatch(parseSpy.parse, "", { filePath: filename }); |
8081 | 8081 | }); |
8082 | 8082 |
|
8083 | 8083 | it("should not report an error when JSX code contains a spread operator and JSX is enabled", () => { |
|
0 commit comments