test: use firebase hosting emulator
This commit is contained in:
parent
17735fd855
commit
cd528cd130
9 changed files with 64 additions and 6 deletions
|
@ -4,8 +4,8 @@
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "open-cli http://localhost:3000 && next dev",
|
"dev": "open-cli http://localhost:3000 && next dev",
|
||||||
"dev:headless": "next dev",
|
|
||||||
"build": "next build",
|
"build": "next build",
|
||||||
|
"serve": "cd ../.. && firebase emulators:start --only hosting --config=firebase.test.blog.json",
|
||||||
"lint": "next lint",
|
"lint": "next lint",
|
||||||
"test:e2e": "playwright test",
|
"test:e2e": "playwright test",
|
||||||
"clean": "rm -rf .next .turbo build node_modules test-results"
|
"clean": "rm -rf .next .turbo build node_modules test-results"
|
||||||
|
|
|
@ -16,7 +16,7 @@ const config: PlaywrightTestConfig = {
|
||||||
// Run your local dev server before starting the tests:
|
// Run your local dev server before starting the tests:
|
||||||
// https://playwright.dev/docs/test-advanced#launching-a-development-web-server-during-the-tests
|
// https://playwright.dev/docs/test-advanced#launching-a-development-web-server-during-the-tests
|
||||||
webServer: {
|
webServer: {
|
||||||
command: "pnpm build && pnpm serve",
|
command: "pnpm serve",
|
||||||
url: baseURL,
|
url: baseURL,
|
||||||
timeout: 120 * 1000,
|
timeout: 120 * 1000,
|
||||||
// eslint-disable-next-line turbo/no-undeclared-env-vars
|
// eslint-disable-next-line turbo/no-undeclared-env-vars
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"cp": "cp ../../packages/content/dist/skills.svg ../../packages/content/dist/resume.pdf static",
|
"cp": "cp ../../packages/content/dist/skills.svg ../../packages/content/dist/resume.pdf static",
|
||||||
"dev": "vite dev",
|
"dev": "vite dev",
|
||||||
"dev:headless": "vite dev --open false",
|
|
||||||
"build": "pnpm cp && vite build",
|
"build": "pnpm cp && vite build",
|
||||||
|
"serve": "cd ../.. && firebase emulators:start --only hosting --config=firebase.test.main.json",
|
||||||
"test:e2e": "playwright test",
|
"test:e2e": "playwright test",
|
||||||
"clean": "rm -rf .turbo .svelte-kit build node_modules vite.config.ts.timestamp-*",
|
"clean": "rm -rf .turbo .svelte-kit build node_modules vite.config.ts.timestamp-*",
|
||||||
"lint": "eslint ."
|
"lint": "eslint ."
|
||||||
|
|
|
@ -16,7 +16,7 @@ const config: PlaywrightTestConfig = {
|
||||||
// Run your local dev server before starting the tests:
|
// Run your local dev server before starting the tests:
|
||||||
// https://playwright.dev/docs/test-advanced#launching-a-development-web-server-during-the-tests
|
// https://playwright.dev/docs/test-advanced#launching-a-development-web-server-during-the-tests
|
||||||
webServer: {
|
webServer: {
|
||||||
command: "pnpm dev:headless",
|
command: "pnpm serve",
|
||||||
url: baseURL,
|
url: baseURL,
|
||||||
timeout: 120 * 1000,
|
timeout: 120 * 1000,
|
||||||
// eslint-disable-next-line turbo/no-undeclared-env-vars
|
// eslint-disable-next-line turbo/no-undeclared-env-vars
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "open-cli http://localhost:5174 && next dev -p 5174",
|
"dev": "open-cli http://localhost:5174 && next dev -p 5174",
|
||||||
"dev:headless": "next dev -p 5174",
|
|
||||||
"build": "next build",
|
"build": "next build",
|
||||||
|
"serve": "cd ../.. && firebase emulators:start --only hosting --config=firebase.test.portfolio.json",
|
||||||
"test:e2e": "playwright test",
|
"test:e2e": "playwright test",
|
||||||
"lint": "next lint",
|
"lint": "next lint",
|
||||||
"clean": "rm -rf .next .turbo dist node_modules test-results"
|
"clean": "rm -rf .next .turbo dist node_modules test-results"
|
||||||
|
|
|
@ -16,7 +16,7 @@ const config: PlaywrightTestConfig = {
|
||||||
// Run your local dev server before starting the tests:
|
// Run your local dev server before starting the tests:
|
||||||
// https://playwright.dev/docs/test-advanced#launching-a-development-web-server-during-the-tests
|
// https://playwright.dev/docs/test-advanced#launching-a-development-web-server-during-the-tests
|
||||||
webServer: {
|
webServer: {
|
||||||
command: "pnpm dev:headless",
|
command: "pnpm serve",
|
||||||
url: baseURL,
|
url: baseURL,
|
||||||
timeout: 120 * 1000,
|
timeout: 120 * 1000,
|
||||||
// eslint-disable-next-line turbo/no-undeclared-env-vars
|
// eslint-disable-next-line turbo/no-undeclared-env-vars
|
||||||
|
|
20
firebase.test.blog.json
Normal file
20
firebase.test.blog.json
Normal 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
19
firebase.test.main.json
Normal 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
19
firebase.test.portfolio.json
Normal file
19
firebase.test.portfolio.json
Normal 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue