-
Notifications
You must be signed in to change notification settings - Fork 243
Closed
Description
I have a test case that relies on multiple promises being tested with Promise.all:
test('Resource loader: client usage', function () {
expect.assertions(2);
const quxLoader = ResourceLoader.create(['qux']);
let promiseResolve;
fetchResult = new Promise(resolve => promiseResolve = resolve);
const promise1 = quxLoader.load();
promise1.then(([x]) => expect(x.test).toBeTruthy());
const promise2 = quxLoader.load();
promise2.then(([x]) => expect(x.test).toBeTruthy());
promiseResolve({test: true});
return Promise.all([promise1, promise2]);
});This causes the following eslint errors:
68:3 error Promise should be returned to test its fulfillment or rejection jest/valid-expect-in-promise
70:3 error Promise should be returned to test its fulfillment or rejection jest/valid-expect-in-promise
It'd be great if the rule would recognize Promise.all and considered it valid.
mattlean and darcyrush