Skip to content

Commit ad68e15

Browse files
committed
feature/cache: Add tests to verify an error is thrown on misconfiguration of resolverCache
1 parent f9afd43 commit ad68e15

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/cache.spec.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@ describe('cache()', () => {
1212
};
1313
});
1414

15+
describe('errors', () => {
16+
it('throws when no resolverCache is configured', () => {
17+
const resolver = cache(() => {});
18+
expect(() =>
19+
resolver(parent, args, { resolverCache: undefined })
20+
).toThrowErrorMatchingSnapshot();
21+
});
22+
});
23+
1524
describe('hashing', () => {
1625
it('hashes the root and arguments consistently', () => {
1726
const resolver = cache(() => {});

0 commit comments

Comments
 (0)