@@ -26,7 +26,7 @@ if (task.type === 'module') {
2626
2727## relativeModuleId
2828
29- Module id relative to the project. This is the same as ` task.name ` in the deprecated API.
29+ 相对于项目的模块 ID。这与已弃用 API 中的 ` task.name ` 相同。
3030
3131``` ts
3232' project/example.test.ts' // ✅
@@ -54,12 +54,12 @@ function meta(): TaskMeta
5454import { test } from 'vitest'
5555
5656describe('the validation works correctly', (task) => {
57- // assign "decorated" during collection
57+ // 在收集阶段分配 "decorated"
5858 task.file.meta.decorated = false
5959
6060 test('some test', ({ task }) => {
61- // assign "decorated" during test run, it will be available
62- // only in onTestCaseReady hook
61+ // 在测试运行期间分配 "decorated",它将可用
62+ // 仅在 onTestCaseReady 钩子中
6363 task.file.meta.decorated = false
6464 })
6565})
@@ -80,43 +80,43 @@ function diagnostic(): ModuleDiagnostic
8080` ` ` ts
8181interface ModuleDiagnostic {
8282 /**
83- * The time it takes to import and initiate an environment.
83+ * 导入和初始化环境所需的时间。
8484 */
8585 readonly environmentSetupDuration: number
8686 /**
87- * The time it takes Vitest to setup test harness (runner, mocks, etc.).
87+ * Vitest 设置测试运行环境(运行器、模拟等)所需的时间。
8888 */
8989 readonly prepareDuration: number
9090 /**
91- * The time it takes to import the test module.
92- * This includes importing everything in the module and executing suite callbacks.
91+ * 导入测试模块所需的时间。
92+ * 这包括导入模块中的所有内容以及执行套件回调函数。
9393 */
9494 readonly collectDuration: number
9595 /**
96- * The time it takes to import the setup module.
96+ * 导入设置模块所需的时间。
9797 */
9898 readonly setupDuration: number
9999 /**
100- * Accumulated duration of all tests and hooks in the module.
100+ * 模块中所有测试和钩子函数的累计持续时间。
101101 */
102102 readonly duration: number
103103 /**
104- * The amount of memory used by the module in bytes.
105- * This value is only available if the test was executed with ` logHeapUsage ` flag.
104+ * 模块使用的内存量(以字节为单位)。
105+ * 此值仅在使用 ` logHeapUsage ` 标志执行测试时才可用。
106106 */
107107 readonly heap: number | undefined
108108 /**
109- * The time spent importing every non-externalized dependency that Vitest has processed.
109+ * Vitest处理的每个非外部化依赖项的导入时间。
110110 */
111111 readonly importDurations: Record<string, ImportDuration>
112112}
113113
114- /** The time spent importing & executing a non-externalized file. */
114+ /** 导入和执行非外部化文件所花费的时间。 */
115115interface ImportDuration {
116- /** The time spent importing & executing the file itself, not counting all non-externalized imports that the file does. */
116+ /** 导入和执行文件本身所花费的时间,不包括该文件所依赖的所有非外部化导入。 */
117117 selfTime: number
118118
119- /** The time spent importing & executing the file and all its imports. */
119+ /** 导入和执行文件及其所有导入项所花费的时间。 */
120120 totalTime: number
121121}
122122` ` `
0 commit comments