diff --git a/src/test/__snapshots__/cli.test.ts.snap b/src/test/__snapshots__/cli.test.ts.snap index b5932a1..7919eb4 100644 --- a/src/test/__snapshots__/cli.test.ts.snap +++ b/src/test/__snapshots__/cli.test.ts.snap @@ -1,7 +1,7 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`CLI > should display package report 1`] = ` -"e18e (cli v0.0.1) +"e18e (cli ) ┌ Analyzing... │ @@ -27,7 +27,7 @@ exports[`CLI > should display package report 1`] = ` exports[`CLI > should display package report 2`] = `""`; exports[`CLI > should run successfully with default options 1`] = ` -"e18e (cli v0.0.1) +"e18e (cli ) ┌ Analyzing... │ diff --git a/src/test/cli.test.ts b/src/test/cli.test.ts index 877b3ea..5ecb083 100644 --- a/src/test/cli.test.ts +++ b/src/test/cli.test.ts @@ -6,6 +6,11 @@ import {createTempDir, cleanupTempDir, createTestPackage} from './utils.js'; let mockTarballPath: string; let tempDir: string; +const stripVersion = (str: string): string => + str.replace( + new RegExp(/\(cli v\d+\.\d+\.\d+(?:-\S+)?\)/, 'g'), + '(cli )' + ); beforeAll(async () => { // Create a temporary directory for the test package @@ -90,7 +95,7 @@ describe('CLI', () => { console.error('CLI Error:', stderr); } expect(code).toBe(0); - expect(stdout).toMatchSnapshot(); + expect(stripVersion(stdout)).toMatchSnapshot(); expect(stderr).toBe(''); }); @@ -100,7 +105,7 @@ describe('CLI', () => { tempDir ); expect(code).toBe(0); - expect(stdout).toMatchSnapshot(); + expect(stripVersion(stdout)).toMatchSnapshot(); expect(stderr).toMatchSnapshot(); }); });