Skip to content

Commit 3ff6859

Browse files
authored
chore: refactor tests directory structure (#241)
1 parent 1c05552 commit 3ff6859

File tree

329 files changed

+472
-499
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

329 files changed

+472
-499
lines changed

.github/workflows/test-ubuntu.yml

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@ on:
1717
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1818
jobs:
1919
# ======== ut ========
20-
ut-mac:
21-
# run ut in MacOS, as SWC cases will fail in Ubuntu CI
22-
runs-on: macos-14
20+
ut-ubuntu:
21+
runs-on: ubuntu-latest
2322
strategy:
2423
matrix:
2524
node-version: [18.x]
@@ -60,8 +59,8 @@ jobs:
6059
if: steps.changes.outputs.changed == 'true'
6160
run: pnpm run test:unit
6261

63-
# ======== e2e ========
64-
e2e-ubuntu:
62+
# ======== integration && e2e ========
63+
integration-e2e-ubuntu:
6564
runs-on: ubuntu-latest
6665
strategy:
6766
matrix:
@@ -97,18 +96,12 @@ jobs:
9796

9897
- name: Install Dependencies
9998
if: steps.changes.outputs.changed == 'true'
100-
run: pnpm install && cd ./e2e && pnpx playwright install
101-
102-
- name: E2E Artifact Test (Vitest)
103-
if: steps.changes.outputs.changed == 'true'
104-
run: pnpm run test:artifact
99+
run: pnpm install && cd ./tests && npx playwright install
105100

106-
- name: Examples Test
101+
- name: Features Integration Test (Vitest)
107102
if: steps.changes.outputs.changed == 'true'
108-
run: |
109-
pnpm run build:examples
103+
run: pnpm run test:features
110104

111-
- name: E2E Test (Playwright)
105+
- name: Examples E2E Test (Playwright)
112106
if: steps.changes.outputs.changed == 'true'
113107
run: pnpm run test:e2e
114-

.github/workflows/test-windows.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ jobs:
6464
if: steps.changes.outputs.changed == 'true'
6565
run: pnpm run test:unit
6666

67-
# # ======== e2e ========
68-
e2e-windows:
67+
# # ======== integration && e2e ========
68+
integration-e2e-windows:
6969
runs-on: windows-latest
7070
strategy:
7171
matrix:
@@ -106,16 +106,12 @@ jobs:
106106

107107
- name: Install Dependencies
108108
if: steps.changes.outputs.changed == 'true'
109-
run: pnpm install && cd ./e2e && npx playwright install
109+
run: pnpm install && cd ./tests && npx playwright install
110110

111-
- name: E2E Artifact Test (Vitest)
111+
- name: Features Integration Test (Vitest)
112112
if: steps.changes.outputs.changed == 'true'
113-
run: pnpm run test:artifact
113+
run: pnpm run test:features
114114

115-
- name: Examples Test
116-
if: steps.changes.outputs.changed == 'true'
117-
run: pnpm run build:examples
118-
119-
- name: E2E Test (Playwright)
115+
- name: Examples E2E Test (Playwright)
120116
if: steps.changes.outputs.changed == 'true'
121117
run: pnpm run test:e2e

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ doc_build/
1212
playwright-report/
1313
tsconfig.tsbuildinfo
1414
test-temp-*
15+
test-results
1516

1617
.vscode/**/*
1718
!.vscode/settings.json

biome.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
},
3737
"linter": {
3838
"enabled": true,
39-
"ignore": ["./e2e/cases/**/*/src/*"],
39+
"ignore": ["./tests/features/**/*/src/*"],
4040
"rules": {
4141
"recommended": true,
4242
"style": {

e2e/cases/copy/index.test.ts

Lines changed: 0 additions & 34 deletions
This file was deleted.

e2e/cases/sourcemap/index.test.ts

Lines changed: 0 additions & 62 deletions
This file was deleted.

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,17 @@
1313
"changeset": "changeset",
1414
"check-dependency-version": "check-dependency-version-consistency .",
1515
"check-spell": "npx cspell",
16-
"lint": "biome check . --diagnostic-level=warn && pnpm run check-spell",
16+
"lint": "biome check . --diagnostic-level=warn && pnpm run check-spell",
1717
"prebundle": "nx run-many -t prebundle",
1818
"prepare": "pnpm run build && simple-git-hooks",
1919
"sort-package-json": "npx sort-package-json \"packages/*/package.json\"",
20-
"test:artifact": "vitest run --project artifact",
21-
"test:artifact:watch": "vitest --project artifact",
22-
"test:e2e": "cd e2e && pnpm run test",
20+
"test": "pnpm run test:unit && pnpm run test:features && pnpm run test:e2e",
21+
"test:e2e": "pnpm run build:examples && cd tests && pnpm run test:e2e",
22+
"test:features": "vitest run --project features",
23+
"test:features:watch": "vitest --project features",
2324
"test:unit": "vitest run --project unit*",
2425
"test:unit:watch": "vitest --project unit*",
25-
"testu": "pnpm run test:unit -u && pnpm run test:artifact -u",
26+
"test:update": "pnpm run test:unit -u && pnpm run test:features -u",
2627
"update:rsbuild": "npx taze minor --include /rsbuild/ -w -r -l",
2728
"watch": "pnpm build --watch"
2829
},

0 commit comments

Comments
 (0)