mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-12 00:27:21 +02:00
refactor: use findAsyncSequential in a few places (#6377)
* refactor: use findAsyncSequential in a few places * fixes * fix
This commit is contained in:
parent
ad16f4fdd9
commit
3cb0972b79
5 changed files with 53 additions and 46 deletions
|
@ -321,11 +321,11 @@ describe('mapAsyncSequential', () => {
|
|||
const timeTotal = timeAfter - timeBefore;
|
||||
|
||||
const totalTimeouts = sum(Object.values(itemToTimeout));
|
||||
expect(timeTotal).toBeGreaterThanOrEqual(totalTimeouts);
|
||||
expect(timeTotal).toBeGreaterThanOrEqual(totalTimeouts - 5);
|
||||
|
||||
expect(itemMapStartsAt['1']).toBeGreaterThanOrEqual(0);
|
||||
expect(itemMapStartsAt['2']).toBeGreaterThanOrEqual(itemMapEndsAt['1']);
|
||||
expect(itemMapStartsAt['3']).toBeGreaterThanOrEqual(itemMapEndsAt['2']);
|
||||
expect(itemMapStartsAt['2']).toBeGreaterThanOrEqual(itemMapEndsAt['1'] - 5);
|
||||
expect(itemMapStartsAt['3']).toBeGreaterThanOrEqual(itemMapEndsAt['2'] - 5);
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -353,8 +353,8 @@ describe('findAsyncSequential', () => {
|
|||
expect(findFn).toHaveBeenNthCalledWith(2, '2');
|
||||
|
||||
const timeTotal = timeAfter - timeBefore;
|
||||
expect(timeTotal).toBeGreaterThanOrEqual(100);
|
||||
expect(timeTotal).toBeLessThan(150);
|
||||
expect(timeTotal).toBeGreaterThanOrEqual(95);
|
||||
expect(timeTotal).toBeLessThan(105);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue