Skip to content

Offline, privacy-first grammar checker. Fast, open-source, Rust-powered

test: debug firefox timeout cases

Asuka1096e9fdc1ade2f
diff --git a/packages/harper.js/package.json b/packages/harper.js/package.json
index d809c2bca..87ed60fd6 100644
--- a/packages/harper.js/package.json
+++ b/packages/harper.js/package.json
@@ -17,7 +17,7 @@
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
- "test": "vitest run --browser",
+ "test": "vitest run",
"test:debug": "vitest run --browser.headless false --testTimeout 0",
"api:extractor": "api-extractor run",
"api:documenter": "api-documenter markdown -i temp"
diff --git a/packages/harper.js/src/Linter.test.ts b/packages/harper.js/src/Linter.test.ts
index b9eb1ac46..c99348e79 100644
--- a/packages/harper.js/src/Linter.test.ts
+++ b/packages/harper.js/src/Linter.test.ts
@@ -133,16 +133,22 @@ for (const [linterName, Linter] of Object.entries(linters)) {
const linter = new Linter({ binary });
const source = 'This is an test.';
+ console.time('lint');
const firstRound = await linter.lint(source);
+ console.timeEnd('lint');
expect(firstRound.length).toBeGreaterThanOrEqual(1);
+ console.time('ignore');
await linter.ignoreLint(firstRound[0]);
+ console.timeEnd('ignore');
+ console.time('lint2');
const secondRound = await linter.lint(source);
+ console.timeEnd('lint2');
expect(secondRound.length).toBeLessThan(firstRound.length);
- });
+ }, 30_000);
test(`${linterName} can reimport ignored lints.`, async () => {
const source = 'This is an test of xporting lints.';