()
| 184 | } |
| 185 | |
| 186 | async function runHandleUpgradeCommand(): Promise<number> { |
| 187 | const exitSpy = vi.spyOn(process, 'exit').mockImplementation((code?: string | number | null) => { |
| 188 | throw new ExitCalled(Number(code ?? 0)); |
| 189 | }); |
| 190 | try { |
| 191 | await handleUpgradeCommand('0.0.1-alpha.2'); |
| 192 | throw new Error('expected process.exit'); |
| 193 | } catch (error) { |
| 194 | if (error instanceof ExitCalled) { |
| 195 | return error.code; |
| 196 | } |
| 197 | throw error; |
| 198 | } finally { |
| 199 | exitSpy.mockRestore(); |
| 200 | } |
| 201 | } |
| 202 | |
| 203 | describe('main entry command handling', () => { |
| 204 | afterEach(() => { |
no test coverage detected