Skip to content

Commit

Permalink
📢
Browse files Browse the repository at this point in the history
  • Loading branch information
manucorporat committed Jul 6, 2023
1 parent b92a114 commit de685f9
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 6 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@ jobs:
- name: Clear dist dir
run: pnpm run clean.dist

- name: Build Node Server
- name: Build Node Server (development)
run: pnpm run build.node-dev

- name: Test Node Server MPA
run: pnpm run test.node.mpa
- name: Test Node Server (development) MPA
run: pnpm run test.node-dev.mpa

- name: Test Node Server SPA
run: pnpm run test.node.spa
- name: Test Node Server (development) SPA
run: pnpm run test.node-dev.spa

- name: Clear dist dir
run: pnpm run clean.dist
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@
"test.netlify.spa": "cross-env APP=spa playwright test tests --config playwright.netlify.config.ts",
"test.node.mpa": "cross-env APP=mpa playwright test tests --config playwright.node.config.ts",
"test.node.spa": "cross-env APP=spa playwright test tests --config playwright.node.config.ts",
"test.node-dev.mpa": "cross-env APP=mpa playwright test tests --config playwright.node-dev.config.ts",
"test.node-dev.spa": "cross-env APP=spa playwright test tests --config playwright.node-dev.config.ts",
"test.preview.mpa": "cross-env APP=mpa playwright test tests --config playwright.preview.config.ts",
"test.preview.spa": "cross-env APP=spa playwright test tests --config playwright.preview.config.ts",
"test.static.mpa": "cross-env APP=mpa playwright test tests/static.spec.ts --config playwright.static.config.ts",
Expand Down
1 change: 1 addition & 0 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const config: PlaywrightTestConfig = {
],
metadata: {
server: "dev",
dev: true,
},
webServer: {
command: "pnpm run dev --port 3005",
Expand Down
18 changes: 18 additions & 0 deletions playwright.node-dev.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import type { PlaywrightTestConfig } from "@playwright/test";
import commonConfig from "./playwright.config";

const config: PlaywrightTestConfig = {
...commonConfig,

metadata: {
server: "node",
dev: true,
},

webServer: {
command: "pnpm run serve.node",
port: 3004,
},
};

export default config;
2 changes: 1 addition & 1 deletion tests/env.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ test("index", async ({ page }, { config }) => {
await expect(page.locator("#env-value-platform")).toHaveText(
config.metadata.server
);
if (config.metadata.server === "dev") {
if (config.metadata.dev) {
await expect(page.locator("#env-value-importMetaEnv")).toHaveText(
"foo dev"
);
Expand Down

0 comments on commit de685f9

Please sign in to comment.