Skip to content

Commit 8566bc4

Browse files
committed
test(solidstart): Add solidstart e2e test app
1 parent 1be3b4a commit 8566bc4

File tree

20 files changed

+450
-2
lines changed

20 files changed

+450
-2
lines changed

dev-packages/e2e-tests/test-applications/solid-solidrouter/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
},
2828
"dependencies": {
2929
"@solidjs/router": "^0.13.5",
30-
"solid-js": "^1.8.11",
30+
"solid-js": "^1.8.18",
3131
"@sentry/solid": "latest || *"
3232
}
3333
}

dev-packages/e2e-tests/test-applications/solid/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"vite-plugin-solid": "^2.8.2"
2727
},
2828
"dependencies": {
29-
"solid-js": "^1.8.11",
29+
"solid-js": "^1.8.18",
3030
"@sentry/solid": "latest || *"
3131
}
3232
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
2+
dist
3+
.solid
4+
.output
5+
.vercel
6+
.netlify
7+
.vinxi
8+
9+
# Environment
10+
.env
11+
.env*.local
12+
13+
# dependencies
14+
/node_modules
15+
/.pnp
16+
.pnp.js
17+
18+
# IDEs and editors
19+
/.idea
20+
.project
21+
.classpath
22+
*.launch
23+
.settings/
24+
25+
# Temp
26+
gitignore
27+
28+
# testing
29+
/coverage
30+
31+
# misc
32+
.DS_Store
33+
.env.local
34+
.env.development.local
35+
.env.test.local
36+
.env.production.local
37+
38+
npm-debug.log*
39+
yarn-debug.log*
40+
yarn-error.log*
41+
42+
/test-results/
43+
/playwright-report/
44+
/playwright/.cache/
45+
46+
!*.d.ts
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@sentry:registry=http://127.0.0.1:4873
2+
@sentry-internal:registry=http://127.0.0.1:4873
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# SolidStart
2+
3+
Everything you need to build a Solid project, powered by [`solid-start`](https://start.solidjs.com);
4+
5+
## Creating a project
6+
7+
```bash
8+
# create a new project in the current directory
9+
npm init solid@latest
10+
11+
# create a new project in my-app
12+
npm init solid@latest my-app
13+
```
14+
15+
## Developing
16+
17+
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
18+
19+
```bash
20+
npm run dev
21+
22+
# or start the server and open the app in a new browser tab
23+
npm run dev -- --open
24+
```
25+
26+
## Building
27+
28+
Solid apps are built with _presets_, which optimise your project for deployment to different environments.
29+
30+
By default, `npm run build` will generate a Node app that you can run with `npm start`. To use a different preset, add it to the `devDependencies` in `package.json` and specify in your `app.config.js`.
31+
32+
## Testing
33+
34+
Tests are written with `vitest`, `@solidjs/testing-library` and `@testing-library/jest-dom` to extend expect with some helpful custom matchers.
35+
36+
To run them, simply start:
37+
38+
```sh
39+
npm test
40+
```
41+
42+
## This project was created with the [Solid CLI](https://solid-cli.netlify.app)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { defineConfig } from '@solidjs/start/config';
2+
3+
export default defineConfig({});
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"name": "example-with-vitest",
3+
"version": "0.0.0",
4+
"scripts": {
5+
"clean": "pnpx rimraf node_modules pnpm-lock.yaml .vinxi .output",
6+
"dev": "NODE_OPTIONS='--import ./src/instrument.server.mjs' vinxi dev",
7+
"build": "vinxi build",
8+
"preview": "HOST=localhost PORT=3030 NODE_OPTIONS='--import ./src/instrument.server.mjs' vinxi start",
9+
"test:prod": "TEST_ENV=production playwright test",
10+
"test:build": "pnpm install && npx playwright install && pnpm build",
11+
"test:assert": "pnpm test:prod"
12+
},
13+
"type": "module",
14+
"dependencies": {
15+
"@sentry/solidstart": "latest || *"
16+
},
17+
"devDependencies": {
18+
"@playwright/test": "^1.44.1",
19+
"@solidjs/meta": "^0.29.4",
20+
"@solidjs/router": "^0.13.4",
21+
"@solidjs/start": "^1.0.2",
22+
"@solidjs/testing-library": "^0.8.7",
23+
"@testing-library/jest-dom": "^6.4.2",
24+
"@testing-library/user-event": "^14.5.2",
25+
"@vitest/ui": "^1.5.0",
26+
"jsdom": "^24.0.0",
27+
"solid-js": "1.8.17",
28+
"typescript": "^5.4.5",
29+
"vinxi": "^0.3.12",
30+
"vite": "^5.2.8",
31+
"vite-plugin-solid": "^2.10.2",
32+
"vitest": "^1.5.0"
33+
}
34+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { getPlaywrightConfig } from '@sentry-internal/test-utils';
2+
3+
const config = getPlaywrightConfig({
4+
startCommand: 'pnpm preview',
5+
port: 3030,
6+
});
7+
8+
export default config;
Binary file not shown.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { MetaProvider, Title } from '@solidjs/meta';
2+
import { Router } from '@solidjs/router';
3+
import { FileRoutes } from '@solidjs/start/router';
4+
import { Suspense } from 'solid-js';
5+
6+
export default function App() {
7+
return (
8+
<Router
9+
root={props => (
10+
<MetaProvider>
11+
<Title>SolidStart - with Vitest</Title>
12+
<Suspense>{props.children}</Suspense>
13+
</MetaProvider>
14+
)}
15+
>
16+
<FileRoutes />
17+
</Router>
18+
);
19+
}

0 commit comments

Comments
 (0)