mirror of
https://github.com/gethomepage/homepage.git
synced 2026-10-15 15:09:56 -07:00
Docker CI / Docker Build & Push (push) Canceled after 0s
Lint / Linting Checks (push) Canceled after 0s
Release Drafter / Update Release Draft (push) Canceled after 0s
Release Drafter / Auto Label PR (push) Canceled after 0s
Tests / vitest (1) (push) Canceled after 0s
Tests / vitest (2) (push) Canceled after 0s
Tests / vitest (3) (push) Canceled after 0s
Tests / vitest (4) (push) Canceled after 0s
20 lines
642 B
JavaScript
20 lines
642 B
JavaScript
import { readdirSync } from "fs";
|
|
|
|
import { expect, it } from "vitest";
|
|
|
|
// Next compiles everything under src/pages into routes, so a colocated test ships
|
|
// to users and drags its dev dependencies into the runtime image.
|
|
function filesIn(dir, found = []) {
|
|
readdirSync(dir, { withFileTypes: true }).forEach((entry) => {
|
|
const path = `${dir}/${entry.name}`;
|
|
if (entry.isDirectory()) filesIn(path, found);
|
|
else found.push(path);
|
|
});
|
|
return found;
|
|
}
|
|
|
|
it("keeps test files out of src/pages", () => {
|
|
const tests = filesIn("src/pages").filter((path) => /\.(test|spec)\.[jt]sx?$/.test(path));
|
|
expect(tests).toEqual([]);
|
|
});
|