Skip to content

Commit 84c913d

Browse files
committed
Create a test server using Vite
To serve the generator build to Playwright.
1 parent 2569987 commit 84c913d

File tree

10 files changed

+634
-13
lines changed

10 files changed

+634
-13
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"scripts": {
99
"build": "tsc",
1010
"postbuild": "node post-build.js",
11+
"test-server": "cd test-server && npm run dev",
1112
"test": "npm run build && npx playwright test"
1213
},
1314
"repository": {

playwright.config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,9 @@ export default defineConfig({
3737
use: { ...devices['Desktop Safari'] },
3838
},
3939
],
40+
webServer: {
41+
command: 'npm run test-server',
42+
port: 5173,
43+
reuseExistingServer: false
44+
}
4045
});

test-server/index.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>CSS to HTML</title>
7+
<script type="module" src="/src/main.ts" defer></script>
8+
</head>
9+
<body style="font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;">
10+
<p>Press <kbd>F12</kbd> to open the console.</p>
11+
</body>
12+
</html>

0 commit comments

Comments
 (0)