test: use firebase hosting emulator

This commit is contained in:
Kim, Jimin 2023-07-29 10:41:55 +09:00
parent 17735fd855
commit cd528cd130
Signed by: pomp
GPG key ID: CE1DDB8A4A765403
9 changed files with 64 additions and 6 deletions

View file

@ -4,8 +4,8 @@
"private": true,
"scripts": {
"dev": "open-cli http://localhost:3000 && next dev",
"dev:headless": "next dev",
"build": "next build",
"serve": "cd ../.. && firebase emulators:start --only hosting --config=firebase.test.blog.json",
"lint": "next lint",
"test:e2e": "playwright test",
"clean": "rm -rf .next .turbo build node_modules test-results"

View file

@ -16,7 +16,7 @@ const config: PlaywrightTestConfig = {
// Run your local dev server before starting the tests:
// https://playwright.dev/docs/test-advanced#launching-a-development-web-server-during-the-tests
webServer: {
command: "pnpm build && pnpm serve",
command: "pnpm serve",
url: baseURL,
timeout: 120 * 1000,
// eslint-disable-next-line turbo/no-undeclared-env-vars

View file

@ -6,8 +6,8 @@
"scripts": {
"cp": "cp ../../packages/content/dist/skills.svg ../../packages/content/dist/resume.pdf static",
"dev": "vite dev",
"dev:headless": "vite dev --open false",
"build": "pnpm cp && vite build",
"serve": "cd ../.. && firebase emulators:start --only hosting --config=firebase.test.main.json",
"test:e2e": "playwright test",
"clean": "rm -rf .turbo .svelte-kit build node_modules vite.config.ts.timestamp-*",
"lint": "eslint ."

View file

@ -16,7 +16,7 @@ const config: PlaywrightTestConfig = {
// Run your local dev server before starting the tests:
// https://playwright.dev/docs/test-advanced#launching-a-development-web-server-during-the-tests
webServer: {
command: "pnpm dev:headless",
command: "pnpm serve",
url: baseURL,
timeout: 120 * 1000,
// eslint-disable-next-line turbo/no-undeclared-env-vars

View file

@ -4,8 +4,8 @@
"private": true,
"scripts": {
"dev": "open-cli http://localhost:5174 && next dev -p 5174",
"dev:headless": "next dev -p 5174",
"build": "next build",
"serve": "cd ../.. && firebase emulators:start --only hosting --config=firebase.test.portfolio.json",
"test:e2e": "playwright test",
"lint": "next lint",
"clean": "rm -rf .next .turbo dist node_modules test-results"

View file

@ -16,7 +16,7 @@ const config: PlaywrightTestConfig = {
// Run your local dev server before starting the tests:
// https://playwright.dev/docs/test-advanced#launching-a-development-web-server-during-the-tests
webServer: {
command: "pnpm dev:headless",
command: "pnpm serve",
url: baseURL,
timeout: 120 * 1000,
// eslint-disable-next-line turbo/no-undeclared-env-vars

20
firebase.test.blog.json Normal file
View file

@ -0,0 +1,20 @@
{
"hosting": {
"cleanUrls": true,
"trailingSlash": false,
"public": "apps/blog/build",
"ignore": ["**/.*"]
},
"emulators": {
"hub": {
"name": "hub",
"host": "localhost",
"port": 4400
},
"hosting": {
"host": "localhost",
"port": 3000
}
}
}

19
firebase.test.main.json Normal file
View file

@ -0,0 +1,19 @@
{
"hosting": {
"cleanUrls": true,
"trailingSlash": false,
"public": "apps/main/build",
"ignore": ["**/.*"]
},
"emulators": {
"hub": {
"name": "hub",
"host": "localhost",
"port": 4401
},
"hosting": {
"port": 5173
}
}
}

View file

@ -0,0 +1,19 @@
{
"hosting": {
"cleanUrls": true,
"trailingSlash": false,
"public": "apps/portfolio/dist",
"ignore": ["**/.*"]
},
"emulators": {
"hub": {
"name": "hub",
"host": "localhost",
"port": 4402
},
"hosting": {
"port": 5174
}
}
}