-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
141 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: ci | ||
"on": | ||
- push | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
- run: corepack enable | ||
- run: pnpm i | ||
- run: pnpm lint-check | ||
- run: pnpm tsc | ||
- run: pnpm build | ||
- run: npx playwright install chromium | ||
- run: pnpm -C examples/react-ssr test-e2e | ||
- run: pnpm -C examples/react-ssr build | ||
- run: pnpm -C examples/react-ssr test-e2e-preview | ||
- run: pnpm -C examples/react-server test-e2e | ||
- run: pnpm -C examples/react-server build | ||
- run: pnpm -C examples/react-server test-e2e-preview |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { test, expect } from "@playwright/test"; | ||
|
||
test("basic", async ({ page }) => { | ||
await page.goto("/"); | ||
await expect(page.locator("#root")).toContainText("hydrated: true"); | ||
await expect(page.locator("#root")).toContainText("Count: 0"); | ||
await page.getByRole("button", { name: "+" }).click(); | ||
await expect(page.locator("#root")).toContainText("Count: 1"); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { defineConfig, devices } from "@playwright/test"; | ||
|
||
const port = Number(process.env["E2E_PORT"] || 6174); | ||
const isPreview = Boolean(process.env["E2E_PREVIEW"]); | ||
const command = isPreview | ||
? `pnpm preview --port ${port} --strict-port` | ||
: `pnpm dev --port ${port} --strict-port`; | ||
|
||
export default defineConfig({ | ||
testDir: "e2e", | ||
use: { | ||
trace: "on-first-retry", | ||
}, | ||
projects: [ | ||
{ | ||
name: "chromium", | ||
use: devices["Desktop Chrome"], | ||
}, | ||
], | ||
webServer: { | ||
command, | ||
port, | ||
}, | ||
grepInvert: isPreview ? /@dev/ : /@build/, | ||
forbidOnly: !!process.env["CI"], | ||
retries: process.env["CI"] ? 2 : 0, | ||
reporter: "list", | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { test, expect } from "@playwright/test"; | ||
|
||
test("basic", async ({ page }) => { | ||
await page.goto("/"); | ||
await expect(page.locator("#root")).toContainText("hydrated: true"); | ||
await expect(page.locator("#root")).toContainText("Count: 0"); | ||
await page.getByRole("button", { name: "+" }).click(); | ||
await expect(page.locator("#root")).toContainText("Count: 1"); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { defineConfig, devices } from "@playwright/test"; | ||
|
||
const port = Number(process.env["E2E_PORT"] || 6174); | ||
const isPreview = Boolean(process.env["E2E_PREVIEW"]); | ||
const command = isPreview | ||
? `pnpm preview --port ${port} --strict-port` | ||
: `pnpm dev --port ${port} --strict-port`; | ||
|
||
export default defineConfig({ | ||
testDir: "e2e", | ||
use: { | ||
trace: "on-first-retry", | ||
}, | ||
projects: [ | ||
{ | ||
name: "chromium", | ||
use: devices["Desktop Chrome"], | ||
}, | ||
], | ||
webServer: { | ||
command, | ||
port, | ||
}, | ||
grepInvert: isPreview ? /@dev/ : /@build/, | ||
forbidOnly: !!process.env["CI"], | ||
retries: process.env["CI"] ? 2 : 0, | ||
reporter: "list", | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.