fix: Simplify async update testing
This commit is contained in:
committed by
mrugesh mohapatra
parent
730245e204
commit
1fba44f722
@ -36,9 +36,7 @@ describe('InMemoryCache', () => {
|
||||
it('can handle promises correctly', done => {
|
||||
const cache = inMemoryCache(before, reportErrorStub);
|
||||
const promisedUpdate = () => new Promise(resolve => resolve(after));
|
||||
cache.update(promisedUpdate);
|
||||
// because async
|
||||
setImmediate(() => {
|
||||
cache.update(promisedUpdate).then(() => {
|
||||
expect(cache.get()).toBe(after);
|
||||
done();
|
||||
});
|
||||
|
Reference in New Issue
Block a user