14 lines
641 B
TypeScript
14 lines
641 B
TypeScript
import { expect, test } from "bun:test";
|
|
import { readdirSync, readFileSync } from "node:fs";
|
|
import { basename, dirname, resolve } from "node:path";
|
|
|
|
test("component imports resolve on case-sensitive production filesystems", () => {
|
|
const root = resolve(import.meta.dir, "../components");
|
|
for (const name of readdirSync(root).filter(name => name.endsWith(".wrn"))) {
|
|
for (const match of readFileSync(resolve(root, name), "utf8").matchAll(/from\s+["'](\.[^"']+\.wrn)["']/g)) {
|
|
const target = resolve(root, match[1]);
|
|
expect(readdirSync(dirname(target)), `${name}: ${match[1]}`).toContain(basename(target));
|
|
}
|
|
}
|
|
});
|