test(core): Add test for suppressing error on non-existing filepath (no-changelog) (#7421)

Follow-up to #7411
This commit is contained in:
Iván Ovejero 2023-10-13 11:52:17 +02:00 committed by GitHub
parent 1fb5166376
commit 609f0837cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -151,6 +151,18 @@ describe('deleteMany()', () => {
expect(fsp.rm).toHaveBeenCalledTimes(2); 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()', () => { describe('rename()', () => {