Skip to content

Commit 6288b80

Browse files
committed
test: add error propagation test for createEnvFile
1 parent b714974 commit 6288b80

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

source/__tests__/operations/createEnvFile.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,10 @@ describe('createEnvFile', () => {
2424

2525
expect(exec).toHaveBeenCalledWith(expect.any(String), { cwd: '/other/path' })
2626
})
27+
28+
it('propagates errors from exec', async () => {
29+
vi.mocked(exec).mockRejectedValueOnce(new Error('.env.example not found'))
30+
31+
await expect(createEnvFile('/project/my_app')).rejects.toThrow('.env.example not found')
32+
})
2733
})

0 commit comments

Comments
 (0)