From 609f0837cfa13c2f16ae242ddbf9ea0fb067353e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Fri, 13 Oct 2023 11:52:17 +0200 Subject: [PATCH] test(core): Add test for suppressing error on non-existing filepath (no-changelog) (#7421) Follow-up to #7411 --- packages/core/test/FileSystem.manager.test.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/core/test/FileSystem.manager.test.ts b/packages/core/test/FileSystem.manager.test.ts index 3f72a40a54..039307a57d 100644 --- a/packages/core/test/FileSystem.manager.test.ts +++ b/packages/core/test/FileSystem.manager.test.ts @@ -151,6 +151,18 @@ describe('deleteMany()', () => { expect(fsp.rm).toHaveBeenCalledTimes(2); }); + + it('should suppress error on non-existing filepath', async () => { + const ids = [{ workflowId: 'does-not-exist', executionId: 'does-not-exist' }]; + + fsp.rm = jest.fn().mockResolvedValue(undefined); + + const promise = fsManager.deleteMany(ids); + + await expect(promise).resolves.not.toThrow(); + + expect(fsp.rm).toHaveBeenCalledTimes(1); + }); }); describe('rename()', () => {