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 ## property: FullConfig.reportSlowTests
* since: v1.10 * since: v1.10
- type: <[null]|[Object]> - type: <[null]|[Object]>
- `max` <[int]> The maximum number of slow test files to report. Defaults to `5`. - `max` <[int]> The maximum number of slow test files to report.
- `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.
See [`property: TestConfig.reportSlowTests`]. See [`property: TestConfig.reportSlowTests`].

View file

@ -429,7 +429,7 @@ export default defineConfig({
* since: v1.10 * since: v1.10
- type: ?<[null]|[Object]> - type: ?<[null]|[Object]>
- `max` <[int]> The maximum number of slow test files to report. Defaults to `5`. - `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. Whether to report slow test files. Pass `null` to disable this feature.

View file

@ -99,7 +99,7 @@ export class FullConfigInternal {
metadata: userConfig.metadata, metadata: userConfig.metadata,
preserveOutput: takeFirst(userConfig.preserveOutput, 'always'), preserveOutput: takeFirst(userConfig.preserveOutput, 'always'),
reporter: takeFirst(configCLIOverrides.reporter, resolveReporters(userConfig.reporter, configDir), [[defaultReporter]]), 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), quiet: takeFirst(configCLIOverrides.quiet, userConfig.quiet, false),
projects: [], projects: [],
shard: takeFirst(configCLIOverrides.shard, userConfig.shard, null), shard: takeFirst(configCLIOverrides.shard, userConfig.shard, null),

View file

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

View file

@ -1443,7 +1443,7 @@ interface TestConfig<TestArgs = {}, WorkerArgs = {}> {
max: number; 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; threshold: number;
}; };
@ -1895,12 +1895,12 @@ export interface FullConfig<TestArgs = {}, WorkerArgs = {}> {
*/ */
reportSlowTests: null|{ 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; 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; threshold: number;
}; };