Skip to content

Commit 4211f11

Browse files
committed
Add SSL certificate generation and update Playwright configuration for HTTPS
1 parent 9c61f29 commit 4211f11

4 files changed

Lines changed: 14 additions & 8 deletions

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,15 @@ jobs:
2222
- name: Use Node.js
2323
uses: actions/setup-node@v4
2424
with:
25-
node-version: '22'
26-
cache: 'pnpm'
25+
node-version: "22"
26+
cache: "pnpm"
2727

2828
- name: Install dependencies
2929
run: pnpm install
3030

31+
- name: Generate SSL Certificates
32+
run: pnpm run certs
33+
3134
- name: Build 🔧
3235
run: pnpm run build
3336

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"dev": "concurrently \"pnpm --filter @template/client dev\" \"pnpm --filter @template/server dev\"",
77
"build": "pnpm -r --if-present build",
88
"test": "pnpm -r test",
9+
"certs": "mkdir -p .certs && openssl req -x509 -newkey rsa:2048 -keyout .certs/localhost.key -out .certs/localhost.cert -days 365 -nodes -subj \"/CN=localhost\"",
910
"lint": "oxlint --fix",
1011
"format": "oxfmt --write",
1112
"check": "pnpm -r check && oxlint",

packages/client/playwright.config.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ export default defineConfig({
66
forbidOnly: !!process.env.CI,
77
retries: process.env.CI ? 2 : 0,
88
workers: process.env.CI ? 1 : undefined,
9-
reporter: [['list'], ['html', { open: 'never' }]],
9+
reporter: process.env.CI ? 'github' : 'list',
1010
use: {
11-
baseURL: 'http://localhost:5173',
12-
trace: 'on-first-retry'
11+
baseURL: 'https://localhost:3000',
12+
trace: 'on-first-retry',
13+
ignoreHTTPSErrors: true
1314
},
1415
projects: [
1516
{
@@ -19,7 +20,8 @@ export default defineConfig({
1920
],
2021
webServer: {
2122
command: 'npm run dev',
22-
url: 'http://localhost:5173',
23-
reuseExistingServer: !process.env.CI
23+
url: 'https://localhost:3000',
24+
reuseExistingServer: !process.env.CI,
25+
ignoreHTTPSErrors: true
2426
}
2527
})

packages/client/tests/example.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ test('has title', async ({ page }) => {
66
})
77

88
test('shows server message', async ({ page }) => {
9-
await page.route('http://localhost:3001/health', async (route) => {
9+
await page.route('https://localhost:3001/health', async (route) => {
1010
const json = { message: 'template', status: 'ok' }
1111
await route.fulfill({ json })
1212
})

0 commit comments

Comments
 (0)