mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-17 11:07:07 +02:00
chore: fix flaky tests (#8259)
This commit is contained in:
parent
5baa56b4bf
commit
9f4d2e7136
5 changed files with 10 additions and 10 deletions
3
jest.config.mjs
vendored
3
jest.config.mjs
vendored
|
@ -36,6 +36,9 @@ export default {
|
|||
},
|
||||
testEnvironment: 'node',
|
||||
testPathIgnorePatterns: ignorePatterns,
|
||||
// Default 5s timeout often fails on Windows :s,
|
||||
// see https://github.com/facebook/docusaurus/pull/8259
|
||||
testTimeout: 15000,
|
||||
coveragePathIgnorePatterns: [
|
||||
...ignorePatterns,
|
||||
// We also ignore all package entry points
|
||||
|
|
|
@ -12,7 +12,7 @@ exports[`error prints objects 1`] = `
|
|||
"[ERROR] 1,2,3",
|
||||
],
|
||||
[
|
||||
"[ERROR] Sat Nov 13 2021 00:00:00 GMT+0000 (Coordinated Universal Time)",
|
||||
"[ERROR] Sat, 13 Nov 2021 00:00:00 GMT",
|
||||
],
|
||||
]
|
||||
`;
|
||||
|
@ -29,7 +29,7 @@ exports[`info prints objects 1`] = `
|
|||
"[INFO] 1,2,3",
|
||||
],
|
||||
[
|
||||
"[INFO] Sat Nov 13 2021 00:00:00 GMT+0000 (Coordinated Universal Time)",
|
||||
"[INFO] Sat, 13 Nov 2021 00:00:00 GMT",
|
||||
],
|
||||
]
|
||||
`;
|
||||
|
@ -46,7 +46,7 @@ exports[`success prints objects 1`] = `
|
|||
"[SUCCESS] 1,2,3",
|
||||
],
|
||||
[
|
||||
"[SUCCESS] Sat Nov 13 2021 00:00:00 GMT+0000 (Coordinated Universal Time)",
|
||||
"[SUCCESS] Sat, 13 Nov 2021 00:00:00 GMT",
|
||||
],
|
||||
]
|
||||
`;
|
||||
|
@ -63,7 +63,7 @@ exports[`warn prints objects 1`] = `
|
|||
"[WARNING] 1,2,3",
|
||||
],
|
||||
[
|
||||
"[WARNING] Sat Nov 13 2021 00:00:00 GMT+0000 (Coordinated Universal Time)",
|
||||
"[WARNING] Sat, 13 Nov 2021 00:00:00 GMT",
|
||||
],
|
||||
]
|
||||
`;
|
||||
|
|
|
@ -60,6 +60,9 @@ function stringify(msg: unknown): string {
|
|||
if (String(msg) === '[object Object]') {
|
||||
return JSON.stringify(msg);
|
||||
}
|
||||
if (msg instanceof Date) {
|
||||
return msg.toUTCString();
|
||||
}
|
||||
return String(msg);
|
||||
}
|
||||
|
||||
|
|
|
@ -34,8 +34,6 @@ import type {
|
|||
import type {LoadContext} from '@docusaurus/types';
|
||||
import type {Optional} from 'utility-types';
|
||||
|
||||
jest.setTimeout(15000);
|
||||
|
||||
const fixtureDir = path.join(__dirname, '__fixtures__');
|
||||
|
||||
const createFakeDocFile = ({
|
||||
|
|
|
@ -5,15 +5,11 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
import {jest} from '@jest/globals';
|
||||
import path from 'path';
|
||||
import fs from 'fs-extra';
|
||||
import _ from 'lodash';
|
||||
import {extractThemeCodeMessages} from '../../src/utils';
|
||||
|
||||
// Seems the 5s default timeout fails sometimes
|
||||
jest.setTimeout(15000);
|
||||
|
||||
describe('theme translations', () => {
|
||||
it('has base messages files contain EXACTLY all the translations extracted from the theme. Please run "yarn workspace @docusaurus/theme-translations update" to keep base messages files up-to-date', async () => {
|
||||
const baseMessagesDirPath = path.join(__dirname, '../base');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue