fix: preserve malformed snapshot fixtures
This commit is contained in:
@@ -486,8 +486,10 @@ export function defineAcpSnapshotSuite(options: SnapshotSuiteOptions): void {
|
|||||||
const entries = await readdir(dir, { withFileTypes: true })
|
const entries = await readdir(dir, { withFileTypes: true })
|
||||||
await Promise.all(entries
|
await Promise.all(entries
|
||||||
.filter(entry => entry.isFile()
|
.filter(entry => entry.isFile()
|
||||||
&& entry.name.startsWith('session.')
|
// Only valid numbered children are record-owned stale output.
|
||||||
&& entry.name.endsWith('.jsonl')
|
// Malformed session-like names stay for the inventory guard to
|
||||||
|
// reject instead of being silently deleted during mutation.
|
||||||
|
&& /^session\.[1-9]\d*\.jsonl$/.test(entry.name)
|
||||||
&& !outputNames.has(entry.name))
|
&& !outputNames.has(entry.name))
|
||||||
.map(entry => rm(join(dir, entry.name))))
|
.map(entry => rm(join(dir, entry.name))))
|
||||||
fixtureFiles = outputFixtureFiles
|
fixtureFiles = outputFixtureFiles
|
||||||
|
|||||||
Reference in New Issue
Block a user