You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: advanced/api/index.md
+19-19Lines changed: 19 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,13 +2,13 @@
2
2
title: Advanced API
3
3
---
4
4
5
-
# Getting Started
5
+
# 快速起步
6
6
7
7
::: warning
8
-
This guide lists advanced APIs to run tests via a Node.js script. If you just want to [run tests](/guide/), you probably don't need this. It is primarily used by library authors.
8
+
本指南列出了通过 Node.js 脚本运行测试的高级 API。如果你只是想[运行测试](/guide/),你可能不需要这些内容。这些 API 主要用于库作者。
9
9
:::
10
10
11
-
You can import any method from the `vitest/node`entry-point.
YoucancreateVitestinstancebyusing`createVitest`function. It returns the same [`Vitest`](/advanced/api/vitest) instance as `startVitest`, but it doesn't start tests and doesn't validate installed packages.
DuetohowVite's `createServer` works, Vitest has to resolve the config during the plugin's`configResolve`hook. Therefore, thismethodisnotactuallyusedinternallyandisexposedexclusivelyasapublicAPI.
116
+
由于 Vite 的 `createServer`工作方式,Vitest必须在插件的 `configResolve`钩子中解析配置。因此,此方法实际上并未在内部使用,而是仅作为公共 API 暴露。
0 commit comments