From e144688ccc2e329447cad28febf409c277c36dd1 Mon Sep 17 00:00:00 2001 From: boxofyellow <54955040+boxofyellow@users.noreply.github.com> Date: Thu, 25 Jan 2024 08:34:02 -0800 Subject: [PATCH] Add negative test for createArchives --- __tests__/fs-helper.test.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/__tests__/fs-helper.test.ts b/__tests__/fs-helper.test.ts index b0f6796..8997ec8 100644 --- a/__tests__/fs-helper.test.ts +++ b/__tests__/fs-helper.test.ts @@ -75,7 +75,11 @@ describe('createArchives', () => { expect(tarSHA).toEqual(systemTarHash) }) - // TODO: Test the failure cases + it('creates archives fails if destination cannot be reached', async () => { + await expect( + fsHelper.createArchives('/this/destination/path/does/not/exist', tmpDir) + ).rejects.toThrow(/^ENOENT: no such file or directory, lstat/) + }) }) describe('createTempDir', () => {