Skip to content

Commit b4f9c34

Browse files
Increase timeout
1 parent ffda00f commit b4f9c34

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

test/test.mjs

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,29 @@ import { join, relative } from "path";
22
import { cwd } from "node:process";
33
import { ESLint } from "eslint";
44

5+
// Set timeout to 10s.
6+
// It is observed that the test takes more than 5s to run, while the default timeout is 5s.
7+
const timeout = 10 * 1000;
8+
59
function runTest(filename) {
6-
test(filename, async () => {
7-
const cli = new ESLint();
10+
test(
11+
filename,
12+
async () => {
13+
const cli = new ESLint();
814

9-
const lintResults = await cli.lintFiles([join("src", filename)]);
10-
// Patch the path so that they are the same on any machine.
11-
for (const r of lintResults) {
12-
const absolute = r.filePath;
13-
r.filePath = relative(cwd(), absolute);
14-
}
15+
const lintResults = await cli.lintFiles([join("src", filename)]);
16+
// Patch the path so that they are the same on any machine.
17+
for (const r of lintResults) {
18+
const absolute = r.filePath;
19+
r.filePath = relative(cwd(), absolute);
20+
}
1521

16-
const formatter = await cli.loadFormatter("unix");
17-
const actual = await formatter.format(lintResults);
18-
expect(actual).toMatchSnapshot();
19-
});
22+
const formatter = await cli.loadFormatter("unix");
23+
const actual = await formatter.format(lintResults);
24+
expect(actual).toMatchSnapshot();
25+
},
26+
timeout
27+
);
2028
}
2129

2230
runTest("simple.ts");

0 commit comments

Comments
 (0)