test(snapshot): normalize temporary workspace paths
This commit is contained in:
@@ -20,6 +20,7 @@ import {
|
||||
refreshFixtureReplacements,
|
||||
scrubRequestHeaders,
|
||||
stabilizeRefreshLog,
|
||||
tokenizeSessionFixtureTmpdir,
|
||||
type HarvestedLog,
|
||||
type NormalizeContext,
|
||||
} from '@deepseek-ai/dsh-acp-snapshot'
|
||||
@@ -238,7 +239,7 @@ describe('TypeScript SDK snapshots over the jsonrpc runtime', () => {
|
||||
await Promise.all(ordered.map(async (log, index) => {
|
||||
const file = fixtureFiles(scenario)[index]
|
||||
if (file === undefined) throw new Error(`no fixture path for persisted log ${index}`)
|
||||
await writeFile(file, scrubRequestHeaders(log.content))
|
||||
await writeFile(file, scrubRequestHeaders(tokenizeSessionFixtureTmpdir(log.content)))
|
||||
}))
|
||||
}
|
||||
|
||||
@@ -257,12 +258,19 @@ describe('TypeScript SDK snapshots over the jsonrpc runtime', () => {
|
||||
const existing = expectedContents[index]
|
||||
const file = files[index]
|
||||
if (existing === undefined || file === undefined) throw new Error(`no fixture for persisted log ${index}`)
|
||||
const stable = stabilizeRefreshLog(log.content, existing, replacements, actualContext)
|
||||
const stable = scrubRequestHeaders(tokenizeSessionFixtureTmpdir(
|
||||
stabilizeRefreshLog(log.content, existing, replacements, actualContext),
|
||||
))
|
||||
await writeFile(file, stable)
|
||||
return stable
|
||||
}))
|
||||
}
|
||||
|
||||
for (const [index, expected] of expectedContents.entries()) {
|
||||
expect(scrubRequestHeaders(expected), `${scenario.name} session fixture ${index} carries request-header bulk`)
|
||||
.toBe(expected)
|
||||
}
|
||||
|
||||
// Persisted transcripts match the committed fixtures.
|
||||
const expectedContext = contextOfContents(expectedContents)
|
||||
for (const [index, log] of ordered.entries()) {
|
||||
|
||||
Reference in New Issue
Block a user