Skip to content

Commit

Permalink
test(core): Add test for suppressing error on non-existing filepath (…
Browse files Browse the repository at this point in the history
…no-changelog) (n8n-io#7421)

Follow-up to n8n-io#7411
  • Loading branch information
ivov authored Oct 13, 2023
1 parent 1fb5166 commit 609f083
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/core/test/FileSystem.manager.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()', () => {
Expand Down

0 comments on commit 609f083

Please sign in to comment.