MCPcopy Index your code
hub / github.com/angular/angular-cli / expectFileMatchToExist

Function expectFileMatchToExist

tests/e2e/utils/fs.ts:79–88  ·  view source on GitHub ↗
(dir: string, regex: RegExp)

Source from the content-addressed store, hash-verified

77}
78
79export async function expectFileMatchToExist(dir: string, regex: RegExp): Promise<string> {
80 const files = await fs.readdir(dir);
81 const fileName = files.find((name) => regex.test(name));
82
83 if (!fileName) {
84 throw new Error(`File ${regex} was expected to exist but not found...`);
85 }
86
87 return fileName;
88}
89
90export async function expectFileNotToExist(fileName: string): Promise<void> {
91 try {

Callers 3

update.tsFile · 0.90

Calls 1

findMethod · 0.80

Tested by

no test coverage detected