fix: Simplify async update testing

This commit is contained in:
Bouncey
2018-12-03 17:45:34 +00:00
committed by mrugesh mohapatra
parent 730245e204
commit 1fba44f722

View File

@ -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();
});