-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Labels
p2-nice-to-haveNot breaking anything but nice to have (priority)Not breaking anything but nice to have (priority)
Description
Clear and concise description of the problem
At the moment Vitest can only show information about import breakdown. It would be nice to be able to control it and react to the duration.
Related: #9105
Suggested solution
Enhance the import breakdown feature with these options (WIP):
interface ImportBreakdownOptions {
/**
* Always show an import breakdown after the test summary.
* @default false
*/
enabled?: boolean
/**
* If Vitest finds a file that takes longer than `experimental.importDurationThresholds.warn`,
* it will show an Import Breakdown.
*
* Imports Breakdown is always shown in UI inside the "Module Graph" tab.
* @default true
*/
warnInTerminal?: boolean
/**
* Fail the test run if there is a module that takes longer than `experimental.importDurationThresholds.danger`.
*/
// failOnDanger?: boolean
importDurationThresholds?: {
/**
* Warning threshold in milliseconds. Warning are shown in orange/yellow color.
* @default 100
*/
warn?: number
/**
* Danger threshold in milliseconds. These are shown in red color.
* @defaul 500
*/
danger?: number
},
// @default 10
// throw error if less than 0
// 0 is Infinity
limit?: number
}Turn self/total into a column
Alternative
No response
Additional context
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
p2-nice-to-haveNot breaking anything but nice to have (priority)Not breaking anything but nice to have (priority)
Type
Projects
Status
Approved