fix(js): keep test/helpers.js free of src imports

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
Lucas Winther
2026-10-29 00:03:01 +01:00
co-authored by Claude Sonnet 5.5
parent 59bece5443
commit 045029639e
5 changed files with 13 additions and 8 deletions
+4
View File
@@ -73,3 +73,7 @@ jsFiles(srcDir)
.forEach((f) =>
test(`purity: ${f.slice(srcDir.length + 1)} has no banned constructs`, () =>
assert.deepEqual(violations(readFileSync(f, 'utf8')), [])))
// helpers.js is loaded by every test file; importing src/ there would make all tests fail at load time against the stubs.
test('test/helpers.js imports nothing from src/', () =>
assert.doesNotMatch(readFileSync(join(dirname(fileURLToPath(import.meta.url)), 'helpers.js'), 'utf8'), /from\s+['"][^'"]*src\//))