@gsc-basic/vitest-config 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/index.d.ts +1 -2
- package/dist/index.js +3 -3
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -44,6 +44,8 @@
|
|
|
44
44
|
- `css`: 透传 Vite `css` 配置
|
|
45
45
|
- `test`: Vitest 运行时配置(`environment`、`setupFiles`、`coverage`、`depsInline`、`ui` 等)
|
|
46
46
|
|
|
47
|
+
当前包开箱即用仅保证 `node` 与 `happy-dom` 两类测试环境,这也与内置预设和依赖保持一致。
|
|
48
|
+
|
|
47
49
|
### 预设说明
|
|
48
50
|
|
|
49
51
|
- `node`
|
|
@@ -135,3 +137,4 @@ export default defineVitestConfig({
|
|
|
135
137
|
## 注意事项
|
|
136
138
|
|
|
137
139
|
- 测试代码中直接使用到的库,请在使用方项目显式声明(如 `@vue/test-utils`)。
|
|
140
|
+
- `test.environment` 当前仅建议使用 `node` 或 `happy-dom`,包本身未内置 `jsdom`、`edge-runtime` 相关支持。
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
|
|
2
2
|
import { UserConfig } from "vite";
|
|
3
|
-
|
|
4
3
|
//#region src/typing.d.ts
|
|
5
4
|
type GscVitestPreset = 'node' | 'web' | 'vue';
|
|
6
5
|
interface GscVitestCoverageOptions {
|
|
@@ -15,7 +14,7 @@ interface GscVitestPluginOptions {
|
|
|
15
14
|
vueJsx?: boolean;
|
|
16
15
|
}
|
|
17
16
|
interface GscVitestTestOptions {
|
|
18
|
-
environment?: 'node' | 'happy-dom'
|
|
17
|
+
environment?: 'node' | 'happy-dom';
|
|
19
18
|
includeSource?: string[];
|
|
20
19
|
exclude?: string[];
|
|
21
20
|
setupFiles?: string[];
|
package/dist/index.js
CHANGED
|
@@ -7,8 +7,8 @@ You shall not disclose such Confidential Information and shall use it only in
|
|
|
7
7
|
accordance with the terms of the license agreement.
|
|
8
8
|
|
|
9
9
|
--- Build Info ---
|
|
10
|
-
Version:
|
|
11
|
-
Build Time: 2026/
|
|
12
|
-
Build Commit:
|
|
10
|
+
Version: 1.0.1
|
|
11
|
+
Build Time: 2026/7/24 13:48:38
|
|
12
|
+
Build Commit: bf5044df25fefa2b374b5dfa6cd533cebaf4f662
|
|
13
13
|
*/
|
|
14
14
|
import e from"@vitejs/plugin-vue";import t from"@vitejs/plugin-vue-jsx";import{configDefaults as n,defineConfig as r,mergeConfig as i}from"vitest/config";const a={provider:`v8`,reporter:[`text`,`lcov`]},o={node:{environment:`node`,css:!1,vue:!1,vueJsx:!1},web:{environment:`happy-dom`,css:!0,vue:!1,vueJsx:!1},vue:{environment:`happy-dom`,css:!0,vue:!0,vueJsx:!0}};function s(e){if(e!==!1)return e===!0||e==null?a:{...a,...e}}function c(n,r){let i=[],a=o[r],s=n.plugins?.vue??a.vue,c=n.plugins?.vueJsx??a.vueJsx;return s&&i.push(e()),c&&i.push(t()),i}function l(e={}){let t=e.preset||`node`,r=o[t];return{plugins:c(e,t),root:e.root,resolve:e.resolve,...e.css?{css:e.css}:{},test:{environment:e.test?.environment||r.environment,includeSource:e.test?.includeSource,exclude:[...n.exclude,...e.test?.exclude||[]],setupFiles:e.test?.setupFiles||[],css:e.test?.css??r.css,globals:e.test?.globals,passWithNoTests:e.test?.passWithNoTests,ui:e.test?.ui,server:{deps:{inline:e.test?.depsInline,external:e.test?.depsExternal}},coverage:s(e.test?.coverage)}}}function u(e={},t={}){return r(i(l(e),t))}function d(e,t){return i(e,t)}export{l as createVitestConfig,u as defineVitestConfig,d as mergeVitestConfig};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gsc-basic/vitest-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.2",
|
|
5
5
|
"description": "Vitest Config for GSC Basic Service",
|
|
6
6
|
"author": "Lenovo SSG BASD <-GSC_Scaffolding_Support@lenovo.com>",
|
|
7
7
|
"license": "LicenseRef-Proprietary",
|
|
@@ -29,15 +29,15 @@
|
|
|
29
29
|
"./dist"
|
|
30
30
|
],
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"vite": "^8.
|
|
33
|
-
"vitest": "^4.1.
|
|
32
|
+
"vite": "^8.1.5",
|
|
33
|
+
"vitest": "^4.1.10"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@vitejs/plugin-vue": "^6.0.
|
|
37
|
-
"@vitejs/plugin-vue-jsx": "^5.1.
|
|
38
|
-
"@vitest/coverage-v8": "^4.1.
|
|
39
|
-
"@vitest/ui": "^4.1.
|
|
40
|
-
"happy-dom": "^20.
|
|
36
|
+
"@vitejs/plugin-vue": "^6.0.8",
|
|
37
|
+
"@vitejs/plugin-vue-jsx": "^5.1.6",
|
|
38
|
+
"@vitest/coverage-v8": "^4.1.10",
|
|
39
|
+
"@vitest/ui": "^4.1.10",
|
|
40
|
+
"happy-dom": "^20.11.1"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"build": "tsdown",
|