Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix visual tests #293

Merged
merged 1 commit into from
Jun 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Currently we need two shells to develop the live-editor demo.
./scripts/watch-for-browser.sh
```

2. Start the demo. When the CLI stops rolling, open `http://localhost:3001/demo/live-editor/` in
2. Start the demo. When the CLI stops rolling, open `https://localhost:3001/demo/live-editor/` in
your browser and you will see the editor page. It will reload once `demo/src` or its dependency packages change.

```sh
Expand All @@ -72,5 +72,5 @@ pnpm run compile
Build demo and docs site.

```sh
pnpm run build-site
pnpm run build-site
```
4 changes: 2 additions & 2 deletions demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"cypress:open": "cypress open",
"local-test:visual": "percy exec -- cypress run",
"test:visual": "percy exec -- cypress run --record",
"ci:visual": "start-server-and-test serve http://localhost:3001/demo/preview/ test:visual"
"ci:visual": "start-server-and-test serve http://localhost:3001/demo/preview/ local-test:visual"
},
"dependencies": {
"@codemirror/basic-setup": "^0.20.0",
Expand Down Expand Up @@ -54,7 +54,7 @@
"cypress": "^13.3.2",
"less": "^4.1.3",
"postcss": "^8.4.16",
"start-server-and-test": "^2.0.0",
"start-server-and-test": "^2.0.4",
"tailwindcss": "^3.1.8",
"typescript": "^5.0.0",
"vite": "^5.0.10",
Expand Down
22 changes: 15 additions & 7 deletions demo/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ const mode = process.env.NODE_ENV === 'production' ? 'production' : 'development

const serverAllow = process.env.SERVER_ALLOW || '..'

const enableHttps = process.env.ENABLE_HTTPS === 'true'

// https://vitejs.dev/config/
export default defineConfig({
plugins: [
Expand All @@ -37,9 +39,11 @@ export default defineConfig({
strategies: 'injectManifest',
workbox: {},
}),
ViteMkcert({
savePath: './certs', // save the generated certificate into certs directory
}),
enableHttps
? ViteMkcert({
savePath: './certs', // save the generated certificate into certs directory
})
: null,
],
base: BASE,
mode,
Expand All @@ -48,10 +52,14 @@ export default defineConfig({
// Allow serving files from one level up to the project root
allow: [serverAllow],
},
https: {
cert: './certs/cert.pem',
key: './certs/dev.pem'
}
...(enableHttps
? {
https: {
cert: './certs/cert.pem',
key: './certs/dev.pem',
},
}
: null),
},
build: {
rollupOptions: {
Expand Down
60 changes: 42 additions & 18 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading