[Promise.race/tests] make completion time an inclusive range (#10605)

Backports PR #10511

**Commit 1:**
[Promise.race/tests] make completion time an inclusive range

* Original sha: c077a06f63
* Authored by spalger <spalger@users.noreply.github.com> on 2017-02-22T17:19:40Z
This commit is contained in:
jasper 2017-02-27 19:27:51 -05:00 committed by Spencer
parent eda064af67
commit 34d1e9ff5a

View file

@ -110,8 +110,8 @@ describe('Promise service', function () {
const p2 = new Promise(resolve => setTimeout(resolve, 5000));
await Promise.race([p1, p2]);
const time = Date.now() - start;
expect(time).to.be.lessThan(1000);
expect(time).to.be.greaterThan(100);
expect(time).to.not.be.lessThan(100);
expect(time).to.not.be.greaterThan(2000);
});
it('allows non-promises in the array', async () => {
expect(await Promise.race([1,2,3])).to.be(1);