refactor: Rename resourceExists to hasResource

The function was also moved to the smaller interface ResourceSet.
This commit is contained in:
Joachim Van Herwegen
2022-02-23 15:41:31 +01:00
parent 2ae5924dde
commit 4404fa07d9
26 changed files with 73 additions and 64 deletions

View File

@@ -19,7 +19,7 @@ describe('A PatchOperationHandler', (): void => {
operation = { method: 'PATCH', target: { path: 'http://test.com/foo' }, body, conditions, preferences: {}};
store = {
resourceExists: jest.fn(),
hasResource: jest.fn(),
modifyResource: jest.fn(),
} as any;
@@ -47,7 +47,7 @@ describe('A PatchOperationHandler', (): void => {
});
it('returns the correct response if the resource already exists.', async(): Promise<void> => {
store.resourceExists.mockResolvedValueOnce(true);
store.hasResource.mockResolvedValueOnce(true);
const result = await handler.handle({ operation });
expect(store.modifyResource).toHaveBeenCalledTimes(1);
expect(store.modifyResource).toHaveBeenLastCalledWith(operation.target, body, conditions);