Skip to content

Commit e321c0d

Browse files
committed
test(cli): update postinstall-wrapper mock to export FileSystemError
The previous commit swapped InputError → FileSystemError in postinstall-wrapper.mts but left the test's vi.mock factory still exporting InputError, so the source couldn't resolve its FileSystemError import under vitest: [vitest] No "FileSystemError" export is defined on the ".../src/utils/error/errors.mts" mock Replace the mock's InputError stub with a FileSystemError stub that matches the real class's shape (path, code, recovery) so the source code resolves correctly. The existing regex assertion on the error message is unaffected.
1 parent 769170f commit e321c0d

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

packages/cli/test/unit/commands/wrapper/postinstall-wrapper.test.mts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,19 @@ vi.mock('../../../../src/commands/install/setup-tab-completion.mts', () => ({
6161
}))
6262
vi.mock('../../../../src/utils/error/errors.mts', () => ({
6363
getErrorCause: vi.fn(e => e?.message || String(e)),
64-
InputError: class InputError extends Error {
65-
constructor(message: string) {
64+
FileSystemError: class FileSystemError extends Error {
65+
public readonly path?: string | undefined
66+
public readonly code?: string | undefined
67+
public readonly recovery: string[] = []
68+
constructor(
69+
message: string,
70+
path?: string | undefined,
71+
code?: string | undefined,
72+
) {
6673
super(message)
67-
this.name = 'InputError'
74+
this.name = 'FileSystemError'
75+
this.path = path
76+
this.code = code
6877
}
6978
},
7079
}))

0 commit comments

Comments
 (0)