chore: Tidy up promise handling and testing
This commit is contained in:
committed by
mrugesh mohapatra
parent
f66e59e20c
commit
a1f64f4b77
@ -35,7 +35,8 @@ describe('InMemoryCache', () => {
|
||||
|
||||
it('can handle promises correctly', done => {
|
||||
const cache = inMemoryCache(before, reportErrorStub);
|
||||
cache.update(() => new Promise(resolve => resolve(after)));
|
||||
const promisedUpdate = () => new Promise(resolve => resolve(after));
|
||||
cache.update(promisedUpdate);
|
||||
// because async
|
||||
setImmediate(() => {
|
||||
expect(cache.get()).toBe(after);
|
||||
|
Reference in New Issue
Block a user