diff --git a/packages/cli/test/snapshots.test.ts b/packages/cli/test/snapshots.test.ts index c29f350..72745e5 100644 --- a/packages/cli/test/snapshots.test.ts +++ b/packages/cli/test/snapshots.test.ts @@ -62,7 +62,7 @@ describe("snapshots", async () => { }); for (const [tarball, options] of tests) { - const fixture = tarball + (options ? ` ${options.replace(/ .*[\\\/](?=[^\\\/]*$)/g, " ")}` : ""); + const fixture = tarball + (options ? ` ${stripPaths(options)}` : ""); if (testFilter && !fixture.toLowerCase().includes(testFilter)) { continue; } @@ -88,7 +88,7 @@ describe("snapshots", async () => { `# ${fixture}`, "", "```", - `$ attw ${tarball} ${options ?? defaultOpts}`, + `$ attw ${tarball} ${stripPaths(options ?? defaultOpts)}`, "", [stdout, stderr].filter(Boolean).join("\n"), "", @@ -116,3 +116,7 @@ describe("snapshots", async () => { }); } }); + +function stripPaths(input: string): string { + return input.replace(/ .*[\\\/](?=[^\\\/]*$)/g, " "); +} diff --git a/packages/cli/test/snapshots/big.js@6.2.1.tgz --definitely-typed @types__big.js@6.2.0.tgz.md b/packages/cli/test/snapshots/big.js@6.2.1.tgz --definitely-typed @types__big.js@6.2.0.tgz.md index 4af256d..1279414 100644 --- a/packages/cli/test/snapshots/big.js@6.2.1.tgz --definitely-typed @types__big.js@6.2.0.tgz.md +++ b/packages/cli/test/snapshots/big.js@6.2.1.tgz --definitely-typed @types__big.js@6.2.0.tgz.md @@ -1,7 +1,7 @@ # big.js@6.2.1.tgz --definitely-typed @types__big.js@6.2.0.tgz ``` -$ attw big.js@6.2.1.tgz --definitely-typed /Users/andrew/Developer/arethetypeswrong.github.io/packages/core/test/fixtures/@types__big.js@6.2.0.tgz +$ attw big.js@6.2.1.tgz --definitely-typed @types__big.js@6.2.0.tgz big.js v6.2.1 diff --git a/packages/cli/test/snapshots/react@18.2.0.tgz --definitely-typed @types__react@18.2.21.tgz.md b/packages/cli/test/snapshots/react@18.2.0.tgz --definitely-typed @types__react@18.2.21.tgz.md index 71a6b07..cf64519 100644 --- a/packages/cli/test/snapshots/react@18.2.0.tgz --definitely-typed @types__react@18.2.21.tgz.md +++ b/packages/cli/test/snapshots/react@18.2.0.tgz --definitely-typed @types__react@18.2.21.tgz.md @@ -1,7 +1,7 @@ # react@18.2.0.tgz --definitely-typed @types__react@18.2.21.tgz ``` -$ attw react@18.2.0.tgz --definitely-typed /Users/andrew/Developer/arethetypeswrong.github.io/packages/core/test/fixtures/@types__react@18.2.21.tgz +$ attw react@18.2.0.tgz --definitely-typed @types__react@18.2.21.tgz react v18.2.0 diff --git a/packages/cli/test/snapshots/vue@3.3.4.tgz --include-entrypoints foo -f ascii.md b/packages/cli/test/snapshots/vue@3.3.4.tgz --include-entrypoints foo -f ascii.md index bed4809..5a6ec44 100644 --- a/packages/cli/test/snapshots/vue@3.3.4.tgz --include-entrypoints foo -f ascii.md +++ b/packages/cli/test/snapshots/vue@3.3.4.tgz --include-entrypoints foo -f ascii.md @@ -1,7 +1,7 @@ # vue@3.3.4.tgz --include-entrypoints foo -f ascii ``` -$ attw vue@3.3.4.tgz --include-entrypoints ./foo -f ascii +$ attw vue@3.3.4.tgz --include-entrypoints foo -f ascii vue v3.3.4