Skip to content

Commit

Permalink
fix(examples): prevent port conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
diego-aquino committed May 19, 2024
1 parent 9fe7fcc commit 135d47a
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion examples/with-next-js/.env.development
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
NODE_ENV=development

ZIMIC_SERVER_URL=http://localhost:3001
ZIMIC_SERVER_URL=http://localhost:3005

# NEXT_PUBLIC_GITHUB_API_BASE_URL=https://api.github.com
NEXT_PUBLIC_GITHUB_API_BASE_URL=$ZIMIC_SERVER_URL/github
2 changes: 1 addition & 1 deletion examples/with-next-js/.env.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
NODE_ENV=test

ZIMIC_SERVER_URL=http://localhost:3001
ZIMIC_SERVER_URL=http://localhost:3005
NEXT_PUBLIC_GITHUB_API_BASE_URL=$ZIMIC_SERVER_URL/github
4 changes: 2 additions & 2 deletions examples/with-next-js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ GitHub API and simulate a test case where the repository is found and another wh
pnpm run dev
```

After started, the App Router version will be available at [http://localhost:3000/app](http://localhost:3000/app)
and the Pages Router version at [http://localhost:3000/pages](http://localhost:3000/pages).
After started, the App Router version will be available at [http://localhost:3004/app](http://localhost:3004/app)
and the Pages Router version at [http://localhost:3004/pages](http://localhost:3004/pages).

2. In another terminal, run the tests:

Expand Down
2 changes: 1 addition & 1 deletion examples/with-next-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0",
"private": false,
"scripts": {
"dev": "dotenv -c development -- zimic server start --port 3001 --ephemeral -- next dev --port 3000",
"dev": "dotenv -c development -- zimic server start --port 3005 --ephemeral -- next dev --port 3004",
"test": "dotenv -c test -- dotenv -c development -- playwright test",
"test:turbo": "pnpm run test",
"types:check": "tsc --noEmit",
Expand Down
4 changes: 2 additions & 2 deletions examples/with-next-js/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default defineConfig({
},

use: {
baseURL: 'http://localhost:3000',
baseURL: 'http://localhost:3004',
trace: 'on-first-retry',
screenshot: 'only-on-failure',
video: 'on-first-retry',
Expand All @@ -34,7 +34,7 @@ export default defineConfig({

webServer: {
command: 'pnpm run dev',
port: 3000,
port: 3004,
stdout: 'pipe',
stderr: 'pipe',
reuseExistingServer: true,
Expand Down
2 changes: 1 addition & 1 deletion examples/with-playwright/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ GitHub API and simulate a test case where the repository is found and another wh
pnpm run dev:test
```

After started, it will be available at [http://localhost:3000](http://localhost:3000).
After started, it will be available at [http://localhost:3002](http://localhost:3002).

2. In another terminal, run the tests:

Expand Down

0 comments on commit 135d47a

Please sign in to comment.