You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+14-1Lines changed: 14 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,10 +54,23 @@ We recommend using the `create-solid` package with the **basic** setting.
54
54
55
55
You can also fork this repository and go to `apps/tests`.
56
56
There we have an app with all default configurations and many routes.
57
-
Create a new route, a Cypress assertion to it and open a PR with the failing test-case.
57
+
Create a new route, a Vitest or Playwright assertion (as appropriate) to it and open a PR with the failing test-case.
58
58
59
59
Once the PR is there, **create an issue** and link the PR (mention the PR as you'd mention a person in the issue description and vice versa).
60
60
61
+
##### On testing
62
+
63
+
- If what you'd like to change needs e2e testing (i.e. you need a working build to test your feature), use playwright (see the `/app/tests/e2e` directory for examples).
64
+
- If what you'd like to change is specific to a component, function (i.e. you need a unit test), use Vitest. You can find examples in the `/app/tests/` directory, look for the .tests.ts/.test.tsx files.
65
+
- Note: Vitest is also set-up to test individual components - have a look at `/app/tests/routes/(basic).browser.test.tsx` for an example.
66
+
67
+
#### Testing conventions:
68
+
69
+
- For e2e test, simply place them in the `apps/tests/e2e` directory. The project is configured to run anything found in that directory via playwright as an e2e test.
70
+
- For unit tests, co-locate them in the same place as the component or function they test:
71
+
- E.g. If you're testing `/app/tests/MyComponent.tsx`, create a file named `/app/tests/MyComponent.test.browser.tsx` in the same directory. Note the `.browser` part - that's important to tell Vitest that this test should run in a browser environment.
72
+
- For server-side unit tests, use the same placement conventions as described for components, but create a file named `/app/tests/myfeature.test.server.ts` in the same directory. Using `.server` in the filename tells Vitest that this test should run in a node environment.
73
+
61
74
> [!IMPORTANT]
62
75
> Mark the **allow edit by the maintainers** so we can more easily investigate the failing test and propose a fix. Otherwise we may need to close your PR and cherry-pick your commit.
Copy file name to clipboardExpand all lines: README.md
+6-7Lines changed: 6 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@ SolidStart is a pnpm-based monorepo with nested workspaces. Key directories incl
31
31
32
32
-**`packages/start`**: The core `@solidjs/start` package.
33
33
-**`apps/landing-page`**: The official landing page.
34
-
-**`apps/tests`**: Unit and end-to-end (E2E) tests using Vitest and Cypress.
34
+
-**`apps/tests`**: Unit and end-to-end (E2E) tests using Vitest and Playwright.
35
35
-**`apps/fixtures`**: Fixture projects for testing.
36
36
37
37
Use pnpm filters (e.g. `pnpm --filter @solidjs/start ...`) to target specific packages.
@@ -76,10 +76,10 @@ Then reinstall dependencies and rebuild.
76
76
77
77
End-to-end tests are located in `apps/tests` projects. For manual testing and development use the `apps/fixtures` apps, and finally, integration and unit tests live inside their respective packages.
78
78
79
-
1. Install the Cypress binary (required only once)
79
+
1. Install the Chromium for Playwright binary (required only once)
0 commit comments