mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-29 08:57:03 +02:00
fix(logger): properly stringify objects for logging (#6384)
* fix(logger): properly stringify objects for logging * Add tests
This commit is contained in:
parent
cb747025e8
commit
a9810db1cc
3 changed files with 124 additions and 9 deletions
|
@ -321,11 +321,15 @@ describe('mapAsyncSequential', () => {
|
|||
const timeTotal = timeAfter - timeBefore;
|
||||
|
||||
const totalTimeouts = sum(Object.values(itemToTimeout));
|
||||
expect(timeTotal).toBeGreaterThanOrEqual(totalTimeouts - 5);
|
||||
expect(timeTotal).toBeGreaterThanOrEqual(totalTimeouts - 20);
|
||||
|
||||
expect(itemMapStartsAt['1']).toBeGreaterThanOrEqual(0);
|
||||
expect(itemMapStartsAt['2']).toBeGreaterThanOrEqual(itemMapEndsAt['1'] - 5);
|
||||
expect(itemMapStartsAt['3']).toBeGreaterThanOrEqual(itemMapEndsAt['2'] - 5);
|
||||
expect(itemMapStartsAt['2']).toBeGreaterThanOrEqual(
|
||||
itemMapEndsAt['1'] - 20,
|
||||
);
|
||||
expect(itemMapStartsAt['3']).toBeGreaterThanOrEqual(
|
||||
itemMapEndsAt['2'] - 20,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -353,8 +357,8 @@ describe('findAsyncSequential', () => {
|
|||
expect(findFn).toHaveBeenNthCalledWith(2, '2');
|
||||
|
||||
const timeTotal = timeAfter - timeBefore;
|
||||
expect(timeTotal).toBeGreaterThanOrEqual(95);
|
||||
expect(timeTotal).toBeLessThan(105);
|
||||
expect(timeTotal).toBeGreaterThanOrEqual(80);
|
||||
expect(timeTotal).toBeLessThan(120);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue