fix(js): keep test/helpers.js free of src imports
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
59bece5443
commit
045029639e
@@ -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\//))
|
||||
|
||||
Reference in New Issue
Block a user