Skip to content

Commit

Permalink
Add .env.test, docker-compose.yaml, and dev:test
Browse files Browse the repository at this point in the history
script
  • Loading branch information
Eugen Istoc committed Nov 28, 2023
1 parent 665fd39 commit 79ac4ba
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 7 deletions.
9 changes: 9 additions & 0 deletions .env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
NUXT_PUBLIC_LOGROCKET_APP_ID=""
DATABASE_URL="postgresql://prisma:prisma@localhost:5433/tests"

# Analytics
NUXT_PUBLIC_UMAMI_HOST=""
NUXT_PUBLIC_UMAMI_ID=""

# Floatie
NUXT_PUBLIC_FLOATIE_CLIENT_KEY=''
13 changes: 13 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: '3.9'

services:
db:
image: postgres:16
restart: always
container_name: integration-tests-prisma
ports:
- '5433:5432'
environment:
POSTGRES_USER: prisma
POSTGRES_PASSWORD: prisma
POSTGRES_DB: tests
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
"scripts": {
"build": "prisma generate && prisma migrate deploy && nuxt build",
"dev": "prisma migrate dev && nuxt dev",
"dev:test": "dotenv -e .env.test -- pnpm prisma migrate reset --force && prisma migrate dev && nuxt dev --dotenv .env.test --port 3001",
"docker:up": "docker-compose up -d",
"docker:down": "docker-compose down",
"start": "node .output/server/index.mjs",
"generate": "nuxt generate",
"preview": "nuxt preview",
Expand All @@ -28,6 +31,7 @@
"@types/node": "^20.10.0",
"@vueuse/core": "^10.6.1",
"@vueuse/nuxt": "^10.6.1",
"dotenv-cli": "^7.3.0",
"nuxt": "3.8.2",
"prisma": "^5.6.0",
"vue-tsc": "^1.8.22"
Expand Down
12 changes: 6 additions & 6 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default defineConfig({
reporter: 'html',
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
baseURL: 'http://localhost:3000',
baseURL: 'http://localhost:3001',
trace: 'on-first-retry',
},

Expand Down Expand Up @@ -64,9 +64,9 @@ export default defineConfig({
],

/* Run your local dev server before starting the tests */
// webServer: {
// command: 'pnpm dev',
// url: 'http://127.0.0.1:3000',
// reuseExistingServer: !process.env.CI,
// },
webServer: {
command: 'pnpm dev:test',
url: 'http://localhost:3001',
reuseExistingServer: !process.env.CI,
},
})
19 changes: 18 additions & 1 deletion pnpm-lock.yaml

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

0 comments on commit 79ac4ba

Please sign in to comment.