Skip to content

Commit

Permalink
test: fix tests to use the new ports
Browse files Browse the repository at this point in the history
doc: add instruction to run tests preparations
  • Loading branch information
jtiala committed Jan 19, 2024
1 parent f9d2e4f commit 08da944
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 6 deletions.
11 changes: 6 additions & 5 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@
"build": "storybook build",
"preview": "serve -p 3100 storybook-static",
"test": "pnpm run test:storybook:standalone",
"test:prepare": "pnpm run test:storybook:prepare",
"test:report": "pnpm run test:storybook:standalone:report",
"test:storybook:prepare": "pnpm exec playwright install --with-deps",
"test:storybook": "test-storybook",
"test:storybook:watch": "test-storybook --watch",
"test:storybook:report": "JEST_JUNIT_OUTPUT_FILE=./reports/test-report-storybook.xml test-storybook --junit",
"test:storybook:standalone": "concurrently -k -s first -n SB,TEST -c magenta,blue \"pnpm run build --quiet && pnpm exec serve -Lp 6006 storybook-static\" \"wait-on tcp:6006 && pnpm run test:storybook\"",
"test:storybook:standalone:report": "concurrently -k -s first -n SB,TEST -c magenta,blue \"pnpm run build --quiet && pnpm exec serve -Lp 6006 storybook-static\" \"wait-on tcp:6006 && pnpm run test:storybook:report\"",
"test:storybook": "test-storybook --url http://localhost:3000",
"test:storybook:watch": "test-storybook --url http://localhost:3000 --watch",
"test:storybook:report": "JEST_JUNIT_OUTPUT_FILE=./reports/test-report-storybook.xml test-storybook --url http://localhost:3000 --junit",
"test:storybook:standalone": "concurrently -k -s first -n SB,TEST -c magenta,blue \"pnpm run build --quiet && pnpm exec serve -Lp 3000 storybook-static\" \"wait-on tcp:3000 && pnpm run test:storybook\"",
"test:storybook:standalone:report": "concurrently -k -s first -n SB,TEST -c magenta,blue \"pnpm run build --quiet && pnpm exec serve -Lp 3000 storybook-static\" \"wait-on tcp:3000 && pnpm run test:storybook:report\"",
"lint": "pnpm run lint:tsc && pnpm run lint:eslint",
"lint:report": "pnpm run lint:tsc:report && pnpm run lint:eslint:report",
"lint:fix": "pnpm run lint:eslint:fix",
Expand Down
6 changes: 6 additions & 0 deletions apps/docs/stories/Development.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ pnpm run lint
pnpm run format
```

Before running tests for the first time, run the following command to prepare your environment for testing.

```console
pnpm run test:prepare
```

Linters and formatters are also run in a pre-commit hook for all the staged files.

## Building
Expand Down
1 change: 1 addition & 0 deletions apps/nextjs-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"build": "next build",
"preview": "next start -p 3102",
"test": "pnpm run test:playwright",
"test:prepare": "pnpm run test:playwright:prepare",
"test:report": "pnpm run test:playwright:report",
"test:playwright:prepare": "pnpm exec playwright install --with-deps",
"test:playwright": "PLAYWRIGHT_HTML_REPORT=./reports/test-report-playwright playwright test --reporter=html",
Expand Down
2 changes: 1 addition & 1 deletion apps/nextjs-example/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineConfig, devices } from "@playwright/test";

const baseURL = "http://localhost:8011";
const baseURL = "http://localhost:3002";

export default defineConfig({
testDir: "./test",
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"build": "turbo run build",
"preview": "turbo run preview",
"test": "turbo run test",
"test:prepare": "turbo run test:prepare",
"test:report": "turbo run test:report",
"lint": "turbo run lint",
"lint:report": "turbo run lint:report",
Expand Down
1 change: 1 addition & 0 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"dependsOn": ["^build"]
},
"test": {},
"test:prepare": {},
"test:report": {
"outputs": ["reports/**"]
},
Expand Down

0 comments on commit 08da944

Please sign in to comment.