MCPcopy Create free account
hub / github.com/Dart-Code/Dart-Code / ensureHasRunRecently

Function ensureHasRunRecently

src/test/helpers.ts:1249–1257  ·  view source on GitHub ↗
(root: string, name: string, allowedModificationSeconds = 60)

Source from the content-addressed store, hash-verified

1247}
1248
1249export function ensureHasRunRecently(root: string, name: string, allowedModificationSeconds = 60) {
1250 const hasRunFile = path.isAbsolute(name)
1251 ? name
1252 : path.join(root, `scripts/has_run/${name}`);
1253 assert.ok(fs.existsSync(hasRunFile));
1254 const lastModified = fs.statSync(hasRunFile).mtime;
1255 const modifiedSecondsAgo = (Date.now() - lastModified.getTime()) / 1000;
1256 assert.ok(modifiedSecondsAgo < allowedModificationSeconds, `File hasn't been modified for ${modifiedSecondsAgo} seconds`);
1257}
1258
1259export function ensureHasRunWithArgsStarting(root: string, name: string, expectedArgs: string) {
1260 ensureHasRunRecently(root, name);

Callers 4

doctor.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected