Skip to content

Commit 64261e1

Browse files
test: fix
1 parent eff3db8 commit 64261e1

File tree

7 files changed

+140
-136
lines changed

7 files changed

+140
-136
lines changed

package-lock.json

Lines changed: 109 additions & 110 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,27 +63,26 @@
6363
"@babel/preset-env": "^7.27.2",
6464
"@commitlint/cli": "^19.8.1",
6565
"@commitlint/config-conventional": "^19.8.1",
66-
"@eslint/js": "^9.32.0",
66+
"@eslint/js": "^9.33.0",
6767
"@eslint/markdown": "^7.0.0",
68-
"@stylistic/eslint-plugin": "^5.2.2",
68+
"@stylistic/eslint-plugin": "^5.2.3",
6969
"@types/fs-extra": "^11.0.4",
7070
"@types/micromatch": "^4.0.9",
7171
"@types/node": "^22.15.30",
7272
"@types/normalize-path": "^3.0.2",
73-
"babel-jest": "^30.0.0",
7473
"chokidar": "^4.0.3",
7574
"cross-env": "^7.0.3",
7675
"cspell": "^8.19.4",
7776
"del": "^8.0.0",
7877
"del-cli": "^6.0.0",
79-
"eslint": "^9.32.0",
78+
"eslint": "^9.33.0",
8079
"eslint-config-prettier": "^10.1.8",
81-
"eslint-config-webpack": "^4.4.2",
80+
"eslint-config-webpack": "^4.6.0",
8281
"eslint-plugin-import": "^2.32.0",
8382
"eslint-plugin-jest": "^29.0.1",
84-
"eslint-plugin-jsdoc": "^52.0.0",
83+
"eslint-plugin-jsdoc": "^54.0.0",
8584
"eslint-plugin-n": "^17.21.0",
86-
"eslint-plugin-prettier": "^5.5.3",
85+
"eslint-plugin-prettier": "^5.5.4",
8786
"eslint-plugin-unicorn": "^60.0.0",
8887
"fs-extra": "^11.3.0",
8988
"husky": "^9.1.7",
@@ -93,7 +92,7 @@
9392
"prettier": "^3.6.2",
9493
"standard-version": "^9.5.0",
9594
"typescript": "^5.5.3",
96-
"typescript-eslint": "^8.38.0",
95+
"typescript-eslint": "^8.39.1",
9796
"webpack": "^5.99.9"
9897
},
9998
"peerDependencies": {

test/config-for-tests/eslint.config.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { defineConfig } from "eslint/config";
2-
// eslint-disable-next-line n/no-extraneous-import, import/no-extraneous-dependencies
2+
// eslint-disable-next-line import/no-extraneous-dependencies
33
import globals from "globals";
44

55
export default defineConfig({
@@ -14,6 +14,6 @@ export default defineConfig({
1414
"no-undef": "error",
1515
"no-var": "error",
1616
"no-unused-vars": "error",
17-
"prefer-const": "error"
18-
}
17+
"prefer-const": "error",
18+
},
1919
});

test/eslint-lint.test.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,20 @@ describe("eslint lint", () => {
44
const mockLintFiles = jest.fn().mockReturnValue([]);
55

66
beforeAll(() => {
7-
jest.mock("eslint", () => ({
8-
ESLint: function ESLint() {
7+
jest.mock("eslint", () => {
8+
function ESLint() {
99
this.lintFiles = mockLintFiles;
10-
},
11-
}));
10+
}
11+
12+
ESLint.version = "9.0.0";
13+
14+
return {
15+
ESLint,
16+
async loadESLint() {
17+
return ESLint;
18+
},
19+
};
20+
});
1221
});
1322

1423
beforeEach(() => {

test/eslintignore.test.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ import pack from "./utils/pack";
44

55
describe("eslintignore", () => {
66
it("should ignores files present in .eslintignore", async () => {
7-
const compiler = pack("ignore", { ignore: true });
7+
const compiler = pack("ignore", {
8+
ignore: true,
9+
ignorePatterns: ["**/ignore.js"],
10+
});
811

912
const stats = await compiler.runAsync();
1013
expect(stats.hasWarnings()).toBe(false);

test/fixtures/multiple-entry.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
require('./good');
2-
require('./error');
1+
require("./good");
2+
require("./error");

test/multiple-instances.test.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,10 @@ describe("multiple instances", () => {
1010
{
1111
plugins: [
1212
new ESLintPlugin({
13-
configType: "eslintrc",
1413
ignore: false,
1514
exclude: "error.js",
1615
}),
1716
new ESLintPlugin({
18-
configType: "eslintrc",
1917
ignore: false,
2018
exclude: "error.js",
2119
}),
@@ -35,20 +33,18 @@ describe("multiple instances", () => {
3533
{
3634
plugins: [
3735
new ESLintPlugin({
38-
configType: "eslintrc",
3936
ignore: false,
4037
exclude: "good.js",
4138
}),
4239
new ESLintPlugin({
43-
configType: "eslintrc",
4440
ignore: false,
4541
exclude: "error.js",
4642
}),
4743
],
4844
},
4945
);
5046

51-
await expect(compiler.runAsync()).rejects.toThrow("something");
47+
await expect(compiler.runAsync()).rejects.toThrow("error.js");
5248
});
5349

5450
it("should fail on second instance", async () => {
@@ -58,19 +54,17 @@ describe("multiple instances", () => {
5854
{
5955
plugins: [
6056
new ESLintPlugin({
61-
configType: "eslintrc",
6257
ignore: false,
6358
exclude: "error.js",
6459
}),
6560
new ESLintPlugin({
66-
configType: "eslintrc",
6761
ignore: false,
6862
exclude: "good.js",
6963
}),
7064
],
7165
},
7266
);
7367

74-
await expect(compiler.runAsync()).rejects.toThrow("something");
68+
await expect(compiler.runAsync()).rejects.toThrow("error.js");
7569
});
7670
});

0 commit comments

Comments
 (0)