nix-config/tests/main.ts

30 lines
724 B
TypeScript
Raw Normal View History

import { assertAllModulesInDirectory } from "./lib.ts";
2024-03-30 13:33:53 +01:00
/** A list of directories to check for all Nix modules being imported */
2023-08-31 17:51:44 +02:00
const dirs = [
"containers",
"home",
"modules",
"overlays",
"packages",
"specializations",
];
/** A helper function to return excluded files.
*
* @param directory The directory to get excludes for.
* @returns An array of excluded files for the given directory or undefined.
*/
function getExcludes(directory: string): string[] | undefined {
switch (directory) {
case "packages":
return ["hycov.nix"];
}
}
for (const dir of dirs) {
Deno.test(`imports all modules in ./${dir}`, async () => {
await assertAllModulesInDirectory(dir, getExcludes(dir));
2023-08-31 17:51:44 +02:00
});
}