16 lines
772 B
TypeScript
16 lines
772 B
TypeScript
// SPDX-License-Identifier: LicenseRef-ConusAI-Template-1.0
|
|
// Which `modules/<id>/__tests__/isolation.ts` files the tenant-isolation suite reads: those of the modules
|
|
// the app registers. A module folder that is present but not registered (built and tested, held until its
|
|
// owner opens it) serves no procedure, so its fixtures would name procedures this registry does not have.
|
|
|
|
import { existsSync, readdirSync } from "node:fs"
|
|
import { join } from "node:path"
|
|
|
|
export function isolationFilesOf(modulesDir: string, registered: Iterable<string>): string[] {
|
|
const ids = new Set(registered)
|
|
return readdirSync(modulesDir)
|
|
.filter((id) => ids.has(id))
|
|
.map((id) => join(modulesDir, id, "__tests__", "isolation.ts"))
|
|
.filter((path) => existsSync(path))
|
|
}
|