Skip to content

Commit

Permalink
chore: make tests os agnostic
Browse files Browse the repository at this point in the history
  • Loading branch information
lifeiscontent committed May 8, 2024
1 parent 4aab4cb commit 6c38cc4
Show file tree
Hide file tree
Showing 11 changed files with 15,952 additions and 19,514 deletions.
23 changes: 13 additions & 10 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20
- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v3
with:
version: 8
- name: Download deps
Expand All @@ -35,15 +35,18 @@ jobs:

e2e:
name: E2E Tests
runs-on: ubuntu-latest
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20
- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v3
with:
version: 8
- name: Download deps
Expand All @@ -53,9 +56,9 @@ jobs:
- name: Run tests
run: pnpm exec playwright test
- name: Upload test result
uses: actions/upload-artifact@v2
if: always()
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: test-results
name: test-results-${{ runner.os }}
path: test-results/
retention-days: 30
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@conform-to/validitystate": "workspace:*",
"@conform-to/yup": "workspace:*",
"@conform-to/zod": "workspace:*",
"@playwright/test": "^1.40.1",
"@playwright/test": "^1.43.1",
"@remix-run/eslint-config": "^1.19.3",
"@remix-run/node": "^1.19.3",
"@types/node": "^20.10.4",
Expand Down
4 changes: 2 additions & 2 deletions playground/app/routes/subscription.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export async function loader({ request }: LoaderFunctionArgs) {

return {
noClientValidate: url.searchParams.get('noClientValidate') === 'yes',
isStrcitMode: Boolean(process.env.CI),
isStrictMode: Boolean(process.env.NODE_ENV === 'production'),
};
}

Expand All @@ -54,7 +54,7 @@ export async function action({ request }: ActionFunctionArgs) {
}

export default function Example() {
const { noClientValidate, isStrcitMode: strict } =
const { noClientValidate, isStrictMode: strict } =
useLoaderData<typeof loader>();
const actionData = useActionData<typeof action>();
const [form, fields] = useForm({
Expand Down
Binary file added playground/public/favicon.ico
Binary file not shown.
11 changes: 4 additions & 7 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { type PlaywrightTestConfig } from '@playwright/test';
import { devices } from '@playwright/test';
import { defineConfig, devices } from '@playwright/test';

/**
* Read environment variables from file.
Expand All @@ -10,7 +9,7 @@ import { devices } from '@playwright/test';
/**
* See https://playwright.dev/docs/test-configuration.
*/
const config: PlaywrightTestConfig = {
export default defineConfig({
testDir: './tests/integrations',
/* Maximum time one test can run for. */
timeout: 30 * 1000,
Expand All @@ -30,7 +29,7 @@ const config: PlaywrightTestConfig = {
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
// reporter: 'html',
reporter: process.env.CI ? 'github' : 'list',
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
Expand Down Expand Up @@ -79,6 +78,4 @@ const config: PlaywrightTestConfig = {
stderr: 'pipe',
stdout: 'pipe',
},
};

export default config;
});
Loading

0 comments on commit 6c38cc4

Please sign in to comment.