Skip to content

Commit 136575c

Browse files
andreiborzamydea
andauthored
feat(solidjs): Add e2e tests (#12328)
Co-authored-by: Francesco Novy <francesco.novy@sentry.io>
1 parent 58f75b6 commit 136575c

File tree

21 files changed

+412
-0
lines changed

21 files changed

+412
-0
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,6 +1014,7 @@ jobs:
10141014
'react-router-6-use-routes',
10151015
'react-router-5',
10161016
'react-router-6',
1017+
'solidjs',
10171018
'svelte-5',
10181019
'sveltekit',
10191020
'sveltekit-2',
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# production
12+
/build
13+
14+
# misc
15+
.DS_Store
16+
.env.local
17+
.env.development.local
18+
.env.test.local
19+
.env.production.local
20+
21+
npm-debug.log*
22+
yarn-debug.log*
23+
yarn-error.log*
24+
25+
/test-results/
26+
/playwright-report/
27+
/playwright/.cache/
28+
29+
!*.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: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
## Usage
2+
3+
Those templates dependencies are maintained via [pnpm](https://pnpm.io) via `pnpm up -Lri`.
4+
5+
This is the reason you see a `pnpm-lock.yaml`. That being said, any package manager will work. This file can be safely
6+
be removed once you clone a template.
7+
8+
```bash
9+
$ npm install # or pnpm install or yarn install
10+
```
11+
12+
## Exploring the template
13+
14+
This template's goal is to showcase the routing features of Solid. It also showcase how the router and Suspense work
15+
together to parallelize data fetching tied to a route via the `.data.ts` pattern.
16+
17+
You can learn more about it on the [`@solidjs/router` repository](https://github.com/solidjs/solid-router)
18+
19+
### Learn more on the [Solid Website](https://solidjs.com) and come chat with us on our [Discord](https://discord.com/invite/solidjs)
20+
21+
## Available Scripts
22+
23+
In the project directory, you can run:
24+
25+
### `npm run dev` or `npm start`
26+
27+
Runs the app in the development mode.<br> Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
28+
29+
The page will reload if you make edits.<br>
30+
31+
### `npm run build`
32+
33+
Builds the app for production to the `dist` folder.<br> It correctly bundles Solid in production mode and optimizes the
34+
build for the best performance.
35+
36+
The build is minified and the filenames include the hashes.<br> Your app is ready to be deployed!
37+
38+
## Deployment
39+
40+
You can deploy the `dist` folder to any static host provider (netlify, surge, now, etc.)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1" />
6+
<meta name="theme-color" content="#000000" />
7+
<title>Solid App</title>
8+
</head>
9+
<body>
10+
<noscript>You need to enable JavaScript to run this app.</noscript>
11+
<div id="root"></div>
12+
13+
<script src="/src/index.tsx" type="module"></script>
14+
</body>
15+
</html>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "solidjs",
3+
"version": "0.0.0",
4+
"description": "",
5+
"scripts": {
6+
"build": "vite build",
7+
"clean": "npx rimraf node_modules pnpm-lock.yaml dist",
8+
"dev": "vite",
9+
"preview": "vite preview",
10+
"start": "vite",
11+
"test:prod": "TEST_ENV=production playwright test",
12+
"test:build": "pnpm install && npx playwright install && pnpm build",
13+
"test:assert": "pnpm test:prod"
14+
},
15+
"license": "MIT",
16+
"devDependencies": {
17+
"@playwright/test": "^1.44.1",
18+
"@sentry-internal/test-utils": "link:../../../test-utils",
19+
"@sentry/types": "latest || *",
20+
"@sentry/utils": "latest || *",
21+
"autoprefixer": "^10.4.17",
22+
"postcss": "^8.4.33",
23+
"solid-devtools": "^0.29.2",
24+
"tailwindcss": "^3.4.1",
25+
"vite": "^5.0.11",
26+
"vite-plugin-solid": "^2.8.2"
27+
},
28+
"dependencies": {
29+
"@solidjs/router": "^0.13.5",
30+
"solid-js": "^1.8.11",
31+
"@sentry/solidjs": "latest || *"
32+
}
33+
}
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 --port 3030',
5+
port: 3030,
6+
});
7+
8+
export default config;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
plugins: {
3+
tailwindcss: {},
4+
autoprefixer: {},
5+
},
6+
};
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export default function NotFound() {
2+
return (
3+
<section class="text-gray-700 p-8">
4+
<h1 class="text-2xl font-bold">404: Not Found</h1>
5+
<p class="mt-4">It's gone 😞</p>
6+
</section>
7+
);
8+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;

0 commit comments

Comments
 (0)