mirror of
https://github.com/Buriburizaem0n/admin-frontend-domain.git
synced 2026-09-19 17:50:13 +00:00
ci(e2e): make backend stubs embeddable and keep vitest scoped
The dashboard embed pattern ignores hidden-only dist directories, so the CI backend stub must create visible index.html files. Keep the README in sync and exclude Playwright specs from Vitest so npm run test remains a unit-test command. Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba> Co-authored-by: cloudcode <cloudcode@users.noreply.github.com>
This commit is contained in:
co-authored by
naiba/CloudCode
cloudcode
parent
84fac6d653
commit
11e2f2ca80
@@ -71,7 +71,8 @@ jobs:
|
|||||||
working-directory: nezha
|
working-directory: nezha
|
||||||
run: |
|
run: |
|
||||||
mkdir -p cmd/dashboard/admin-dist cmd/dashboard/user-dist
|
mkdir -p cmd/dashboard/admin-dist cmd/dashboard/user-dist
|
||||||
touch cmd/dashboard/admin-dist/.gitkeep cmd/dashboard/user-dist/.gitkeep
|
printf '<!doctype html><title>admin e2e</title>\n' > cmd/dashboard/admin-dist/index.html
|
||||||
|
printf '<!doctype html><title>user e2e</title>\n' > cmd/dashboard/user-dist/index.html
|
||||||
go install github.com/swaggo/swag/cmd/swag@latest
|
go install github.com/swaggo/swag/cmd/swag@latest
|
||||||
"$(go env GOPATH)/bin/swag" init --pd -d cmd/dashboard -g main.go -o cmd/dashboard/docs
|
"$(go env GOPATH)/bin/swag" init --pd -d cmd/dashboard -g main.go -o cmd/dashboard/docs
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,8 @@ Then start the backend separately. The shape the CI workflow uses is:
|
|||||||
```bash
|
```bash
|
||||||
# in a checkout of nezhahq/nezha
|
# in a checkout of nezhahq/nezha
|
||||||
mkdir -p cmd/dashboard/admin-dist cmd/dashboard/user-dist
|
mkdir -p cmd/dashboard/admin-dist cmd/dashboard/user-dist
|
||||||
touch cmd/dashboard/admin-dist/.gitkeep cmd/dashboard/user-dist/.gitkeep
|
printf '<!doctype html><title>admin e2e</title>\n' > cmd/dashboard/admin-dist/index.html
|
||||||
|
printf '<!doctype html><title>user e2e</title>\n' > cmd/dashboard/user-dist/index.html
|
||||||
go install github.com/swaggo/swag/cmd/swag@latest
|
go install github.com/swaggo/swag/cmd/swag@latest
|
||||||
"$(go env GOPATH)/bin/swag" init --pd -d cmd/dashboard -g main.go -o cmd/dashboard/docs
|
"$(go env GOPATH)/bin/swag" init --pd -d cmd/dashboard -g main.go -o cmd/dashboard/docs
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ export default mergeConfig(
|
|||||||
defineConfig({
|
defineConfig({
|
||||||
test: {
|
test: {
|
||||||
environment: "jsdom",
|
environment: "jsdom",
|
||||||
|
exclude: ["tests/e2e/**", "node_modules/**", "dist/**"],
|
||||||
globals: true,
|
globals: true,
|
||||||
setupFiles: ["./src/test/setup.ts"],
|
setupFiles: ["./src/test/setup.ts"],
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user