Skip to content

Commit aabe4c4

Browse files
committed
Add Dataloader test
1 parent 135f8b8 commit aabe4c4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/__tests__/cache.test.js

+6
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,12 @@ describe('createCachingMethods', () => {
132132
expect(collection.find.mock.calls.length).toBe(1)
133133
})
134134

135+
it(`memoizes with Dataloader`, async () => {
136+
await api.findOneById(docs.one._id)
137+
await api.findOneById(docs.one._id)
138+
expect(collection.find.mock.calls.length).toBe(1)
139+
})
140+
135141
it('finds by field', async () => {
136142
const foundDocs = await api.findByFields({ foo: 'bar' })
137143

0 commit comments

Comments
 (0)