chore: default reportSlowTests to 5 minutes (#34950)

This commit is contained in:
Dmitry Gozman 2025-02-27 16:31:32 +00:00 committed by GitHub
parent 70cc2b14e2
commit 08ea36caa2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 8 additions and 8 deletions

View File

@ -93,8 +93,8 @@ See [`property: TestConfig.reporter`].
## property: FullConfig.reportSlowTests
* since: v1.10
- type: <[null]|[Object]>
- `max` <[int]> The maximum number of slow test files to report. Defaults to `5`.
- `threshold` <[float]> Test duration in milliseconds that is considered slow. Defaults to 15 seconds.
- `max` <[int]> The maximum number of slow test files to report.
- `threshold` <[float]> Test file duration in milliseconds that is considered slow.
See [`property: TestConfig.reportSlowTests`].

View File

@ -429,7 +429,7 @@ export default defineConfig({
* since: v1.10
- type: ?<[null]|[Object]>
- `max` <[int]> The maximum number of slow test files to report. Defaults to `5`.
- `threshold` <[float]> Test duration in milliseconds that is considered slow. Defaults to 15 seconds.
- `threshold` <[float]> Test file duration in milliseconds that is considered slow. Defaults to 5 minutes.
Whether to report slow test files. Pass `null` to disable this feature.

View File

@ -99,7 +99,7 @@ export class FullConfigInternal {
metadata: userConfig.metadata,
preserveOutput: takeFirst(userConfig.preserveOutput, 'always'),
reporter: takeFirst(configCLIOverrides.reporter, resolveReporters(userConfig.reporter, configDir), [[defaultReporter]]),
reportSlowTests: takeFirst(userConfig.reportSlowTests, { max: 5, threshold: 15000 }),
reportSlowTests: takeFirst(userConfig.reportSlowTests, { max: 5, threshold: 300_000 /* 5 minutes */ }),
quiet: takeFirst(configCLIOverrides.quiet, userConfig.quiet, false),
projects: [],
shard: takeFirst(configCLIOverrides.shard, userConfig.shard, null),

View File

@ -605,7 +605,7 @@ export const baseFullConfig: reporterTypes.FullConfig = {
preserveOutput: 'always',
projects: [],
reporter: [[process.env.CI ? 'dot' : 'list']],
reportSlowTests: { max: 5, threshold: 15000 },
reportSlowTests: { max: 5, threshold: 300_000 /* 5 minutes */ },
configFile: '',
rootDir: '',
quiet: false,

View File

@ -1443,7 +1443,7 @@ interface TestConfig<TestArgs = {}, WorkerArgs = {}> {
max: number;
/**
* Test duration in milliseconds that is considered slow. Defaults to 15 seconds.
* Test file duration in milliseconds that is considered slow. Defaults to 5 minutes.
*/
threshold: number;
};
@ -1895,12 +1895,12 @@ export interface FullConfig<TestArgs = {}, WorkerArgs = {}> {
*/
reportSlowTests: null|{
/**
* The maximum number of slow test files to report. Defaults to `5`.
* The maximum number of slow test files to report.
*/
max: number;
/**
* Test duration in milliseconds that is considered slow. Defaults to 15 seconds.
* Test file duration in milliseconds that is considered slow.
*/
threshold: number;
};