Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/test/__snapshots__/cli.test.ts.snap
Original file line number Diff line number Diff line change
@@ -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 <version>)

┌ Analyzing...
│
Expand All @@ -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 <version>)

┌ Analyzing...
│
Expand Down
9 changes: 7 additions & 2 deletions src/test/cli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 <version>)'
);

beforeAll(async () => {
// Create a temporary directory for the test package
Expand Down Expand Up @@ -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('');
});

Expand All @@ -100,7 +105,7 @@ describe('CLI', () => {
tempDir
);
expect(code).toBe(0);
expect(stdout).toMatchSnapshot();
expect(stripVersion(stdout)).toMatchSnapshot();
expect(stderr).toMatchSnapshot();
});
});