Skip to content

Commit

Permalink
chore: use Vite preview to run Cypress E2E tests (#458)
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding authored Jan 31, 2025
1 parent 05b1703 commit d105a7e
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 295 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ jobs:
run: yarn lint

- name: Website Dev Build (served for Cypress)
run: yarn build:demo
run: yarn vite:build

- name: Run Cypress E2E tests
uses: cypress-io/github-action@v6
with:
install: false
# working-directory: packages/dnd
start: yarn serve:demo
start: yarn vite:preview
wait-on: 'http://localhost:8080'
config-file: test/cypress.config.ts
browser: chrome
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
- name: Website Dev Build
if: ${{ inputs.dryrun != true }}
run: yarn build:demo
run: yarn vite:build

# deploy (re-publish) GitHub demo page with a Prod build but only when merging to "master" branch
# and the commit message contains the text "chore: release"
Expand Down
4 changes: 2 additions & 2 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{
"label": "Build GitHub Demo (prod build)",
"type": "shell",
"command": "yarn run build:demo",
"command": "yarn run vite:build",
"problemMatcher": []
},
{
Expand All @@ -28,7 +28,7 @@
{
"label": "Start Library Development",
"type": "shell",
"command": "yarn start",
"command": "yarn vite:start",
"problemMatcher": []
},
{
Expand Down
11 changes: 4 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@
}
],
"scripts": {
"start": "vite",
"build:demo": "tsc && vite build",
"preview": "vite preview",
"delete:dist": "rimraf dist",
"lint": "eslint --cache .",
"lint:no-cache": "eslint .",
Expand All @@ -69,8 +66,9 @@
"cypress:ci": "cypress run --config-file test/cypress.config.ts",
"preview:release": "release-it --dry-run",
"release": "release-it --only-version",
"serve:demo": "serve ./website -l 8080 --no-request-logging",
"pack": "npm pack",
"vite:build": "tsc && vite build",
"vite:preview": "vite preview",
"vite:start": "vite",
"are-type-wrong": "attw --pack ."
},
"browserslist": [
Expand Down Expand Up @@ -145,7 +143,6 @@
"rimraf": "^5.0.10",
"rxjs": "^7.8.1",
"sass": "^1.83.4",
"serve": "^14.2.4",
"typescript": "^5.7.3",
"typescript-eslint": "^8.21.0",
"vite": "^6.0.11",
Expand All @@ -158,4 +155,4 @@
"resolutions": {
"caniuse-lite": "1.0.30001695"
}
}
}
Loading

0 comments on commit d105a7e

Please sign in to comment.