refactor(test/cli): migrate harness short-lived path to AppProcess + FileSystem (#28366)

This commit is contained in:
Kit Langton 2026-05-19 16:18:19 -04:00 • committed by GitHub
commit 80e5fb11c2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -29,7 +29,10 @@ import { normalizeForSnapshot, PATH_SEP } from "../../lib/snapshot"
function normalize(text: string): string {
return normalizeForSnapshot(text, {
pathReplacements: [
[new RegExp(`<TMPDIR>${PATH_SEP}oc-cli-[a-z0-9]+`, "g"), "<HOME>"],
// Mixed-case [A-Za-z0-9] because node's mkdtemp suffix is mixed-case
// (the harness now uses FileSystem.makeTempDirectoryScoped under the
// hood). A `[a-z0-9]+` regex would leave uppercase chars trailing.
[new RegExp(`<TMPDIR>${PATH_SEP}oc-cli-[A-Za-z0-9]+`, "g"), "<HOME>"],
[/\s+\[string\] \[default: "<HOME>"\]/g, ' [string] [default: "<HOME>"]'],
],
})