Skip to content

Commit d6b66d9

Browse files
committed
tests: fix setupEsLintRuleTesters path for windows
1 parent dc26aef commit d6b66d9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/eslint-plugin-qwik/qwik.unit.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,13 @@ interface InvalidTestCase extends TestCase {
4242
}
4343
await (async function setupEsLintRuleTesters() {
4444
// list './test' directory content and set up one RuleTester per directory
45-
const testDir = join(dirname(new URL(import.meta.url).pathname), './tests');
45+
let testDir = join(dirname(new URL(import.meta.url).pathname), './tests');
46+
const isWindows = process.platform === 'win32';
47+
if (isWindows && testDir.startsWith('\\')) {
48+
// in Windows testDir starts with a \ causing errors
49+
testDir = testDir.substring(1);
50+
}
51+
4652
const ruleNames = await readdir(testDir);
4753
for (const ruleName of ruleNames) {
4854
const rule = rules[ruleName];

0 commit comments

Comments
 (0)