(root: string, name: string, allowedModificationSeconds = 60)
| 1247 | } |
| 1248 | |
| 1249 | export 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 | |
| 1259 | export function ensureHasRunWithArgsStarting(root: string, name: string, expectedArgs: string) { |
| 1260 | ensureHasRunRecently(root, name); |
no outgoing calls
no test coverage detected