MCPcopy Create free account
hub / github.com/SoCreate/angular-playground / clearOldTestFiles

Function clearOldTestFiles

projects/cli/src/check-snapshots.ts:225–236  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

223}
224
225const clearOldTestFiles = () => {
226 try {
227 const folderPath = getTestPath().replace('test-image-snapshots.js', '');
228 const oldTestFiles = readdirSync(folderPath)
229 .filter(name => /test-image-snapshots(-\d+x\d+)\.js$/.test(name));
230 for (const name of oldTestFiles) {
231 unlinkSync(`${folderPath}${name}`);
232 }
233 } catch (err) {
234 throw new Error(`Couldn't delete previous test files.`);
235 }
236};
237
238const getTestPath = (suffix = '') =>
239 TEST_PATH_BASE.replace('test-image-snapshots.js', `test-image-snapshots${suffix}.js`);

Callers 2

mainFunction · 0.85
writeSandboxesToTestFileFunction · 0.85

Calls 1

getTestPathFunction · 0.85

Tested by

no test coverage detected