mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-10 15:47:23 +02:00
test: fix some type errors in test files (#7486)
This commit is contained in:
parent
624735bd92
commit
e2e40b8f5f
50 changed files with 319 additions and 182 deletions
|
@ -58,7 +58,7 @@ describe('mapAsyncSequential', () => {
|
|||
const timeBefore = Date.now();
|
||||
await expect(
|
||||
mapAsyncSequential(items, async (item) => {
|
||||
const itemTimeout = itemToTimeout[item];
|
||||
const itemTimeout = itemToTimeout[item]!;
|
||||
itemMapStartsAt[item] = Date.now();
|
||||
await sleep(itemTimeout);
|
||||
itemMapEndsAt[item] = Date.now();
|
||||
|
@ -72,12 +72,10 @@ describe('mapAsyncSequential', () => {
|
|||
const totalTimeouts = _.sum(Object.values(itemToTimeout));
|
||||
expect(timeTotal).toBeGreaterThanOrEqual(totalTimeouts - 100);
|
||||
|
||||
expect(itemMapStartsAt['1']).toBeGreaterThanOrEqual(0);
|
||||
expect(itemMapStartsAt['2']).toBeGreaterThanOrEqual(
|
||||
itemMapEndsAt['1'] - 100,
|
||||
);
|
||||
expect(itemMapStartsAt[1]).toBeGreaterThanOrEqual(0);
|
||||
expect(itemMapStartsAt[2]).toBeGreaterThanOrEqual(itemMapEndsAt[1]! - 100);
|
||||
expect(itemMapStartsAt['3']).toBeGreaterThanOrEqual(
|
||||
itemMapEndsAt['2'] - 100,
|
||||
itemMapEndsAt[2]! - 100,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -10,7 +10,7 @@ import {getFileLoaderUtils} from '../webpackUtils';
|
|||
describe('getFileLoaderUtils()', () => {
|
||||
it('plugin svgo/removeViewBox and removeTitle should be disabled', () => {
|
||||
const {oneOf} = getFileLoaderUtils().rules.svg();
|
||||
expect(oneOf[0].use).toContainEqual(
|
||||
expect(oneOf![0]!.use).toContainEqual(
|
||||
expect.objectContaining({
|
||||
loader: require.resolve('@svgr/webpack'),
|
||||
options: expect.objectContaining({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue