mirror of
https://github.com/donovanglover/nix-config.git
synced 2024-11-26 10:13:25 +01:00
30 lines
724 B
TypeScript
30 lines
724 B
TypeScript
import { assertAllModulesInDirectory } from "./lib.ts";
|
|
|
|
/** A list of directories to check for all Nix modules being imported */
|
|
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));
|
|
});
|
|
}
|