Skip to content

Commit bdb96dd

Browse files
test: fix
1 parent d67fe9e commit bdb96dd

File tree

3 files changed

+41
-1
lines changed

3 files changed

+41
-1
lines changed

test/eslintrc-config.test.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { join } from "node:path";
2+
3+
import pack from "./utils/pack";
4+
5+
describe("succeed on eslintrc-configuration", () => {
6+
it("should work with eslintrc configuration type", async () => {
7+
const overrideConfigFile = join(
8+
__dirname,
9+
"fixtures",
10+
"eslintrc-config.js",
11+
);
12+
const compiler = pack("full-of-problems", {
13+
configType: "eslintrc",
14+
overrideConfigFile,
15+
threads: 1,
16+
});
17+
18+
const stats = await compiler.runAsync();
19+
const { errors } = stats.compilation;
20+
21+
expect(stats.hasErrors()).toBe(true);
22+
expect(errors).toHaveLength(1);
23+
expect(errors[0].message).toContain("full-of-problems.js");
24+
});
25+
});

test/fixtures/eslintrc-config.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module.exports = {
2+
root: true,
3+
parserOptions: {
4+
ecmaVersion: 2018,
5+
env: {
6+
es6: true,
7+
jest: true,
8+
},
9+
sourceType: 'module',
10+
},
11+
rules: {
12+
strict: 'error',
13+
'global-require': 'off',
14+
},
15+
};

test/watch.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ describe("watch", () => {
4848
const [{ message }] = errors;
4949
expect(stats.hasErrors()).toBe(true);
5050
expect(message).toEqual(expect.stringMatching("prefer-const"));
51-
done(err);
51+
done();
5252
}
5353

5454
function thirdPass(err, stats) {

0 commit comments

Comments
 (0)