Skip to content

Commit 7cd8549

Browse files
zoomote[bot]roomote
andauthored
[Chore] Separate extension unit and bundle smoke tests (#1614)
* chore(ci): split extension unit and dist tests * docs(test): clarify dist smoke coverage ownership --------- Co-authored-by: Roomote <[email protected]>
1 parent 745656a commit 7cd8549

4 files changed

Lines changed: 43 additions & 0 deletions

File tree

‎src/package.json‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,10 @@
442442
"lint": "eslint . --ext=ts --max-warnings=0",
443443
"check-types": "tsc --noEmit",
444444
"test": "vitest run",
445+
"test:unit": "vitest run --config vitest.unit.config.ts",
446+
"test:dist": "vitest run --config vitest.dist.config.ts",
445447
"test:coverage": "vitest run --coverage",
448+
"test:coverage:unit": "vitest run --config vitest.unit.config.ts --coverage",
446449
"format": "prettier --write .",
447450
"bundle": "node esbuild.mjs",
448451
"vscode:prepublish": "pnpm bundle --production",

‎src/turbo.json‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,21 @@
55
"test": {
66
"dependsOn": ["$TURBO_EXTENDS$", "bundle"]
77
},
8+
"test:unit": {
9+
"dependsOn": ["@roo-code/types#build"],
10+
"inputs": ["$TURBO_DEFAULT$", "!__tests__/dist_assets.spec.ts"]
11+
},
12+
"test:dist": {
13+
"dependsOn": ["bundle"]
14+
},
815
"test:coverage": {
916
"dependsOn": ["$TURBO_EXTENDS$", "bundle"]
1017
},
18+
"test:coverage:unit": {
19+
"dependsOn": ["@roo-code/types#build"],
20+
"inputs": ["$TURBO_DEFAULT$", "!__tests__/dist_assets.spec.ts"],
21+
"outputs": ["coverage/unit/**"]
22+
},
1123
"bundle": {
1224
"dependsOn": ["^build", "@roo-code/vscode-webview#build"],
1325
"outputs": ["dist/**"]

‎src/vitest.dist.config.ts‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { defineConfig, mergeConfig } from "vitest/config"
2+
3+
import baseConfig from "./vitest.config"
4+
5+
export default mergeConfig(
6+
baseConfig,
7+
defineConfig({
8+
test: {
9+
// This smoke test validates emitted artifacts; source coverage remains in the unit lane.
10+
include: ["__tests__/dist_assets.spec.ts"],
11+
},
12+
}),
13+
)

‎src/vitest.unit.config.ts‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { configDefaults, defineConfig, mergeConfig } from "vitest/config"
2+
3+
import baseConfig from "./vitest.config"
4+
5+
export default mergeConfig(
6+
baseConfig,
7+
defineConfig({
8+
test: {
9+
exclude: [...configDefaults.exclude, "__tests__/dist_assets.spec.ts"],
10+
coverage: {
11+
reportsDirectory: "coverage/unit",
12+
},
13+
},
14+
}),
15+
)

0 commit comments

Comments
 (0)