Skip to content

Commit da10edf

Browse files
authored
test(solid-start): basic-auth e2e suite and example (#5558)
1 parent 410fdf8 commit da10edf

File tree

89 files changed

+2713
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+2713
-2
lines changed

e2e/solid-start/basic-auth/.env

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Environment variables declared in this file are automatically made available to Prisma.
2+
# See the documentation for more detail: https://pris.ly/d/prisma-schema#accessing-environment-variables-from-the-schema
3+
4+
# Prisma supports the native connection string format for PostgreSQL, MySQL, SQLite, SQL Server, MongoDB and CockroachDB.
5+
# See the documentation for all the connection string options: https://pris.ly/d/connection-strings
6+
7+
DATABASE_URL="file:./dev.db"
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
node_modules
2+
package-lock.json
3+
yarn.lock
4+
5+
!.env
6+
.DS_Store
7+
.cache
8+
.vercel
9+
.output
10+
11+
/build/
12+
/api/
13+
/server/build
14+
/public/build
15+
# Sentry Config File
16+
.env.sentry-build-plugin
17+
/test-results/
18+
/playwright-report/
19+
/blob-report/
20+
/playwright/.cache/
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
**/build
2+
**/public
3+
pnpm-lock.yaml
4+
routeTree.gen.ts
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"name": "tanstack-solid-start-e2e-basic-auth",
3+
"private": true,
4+
"sideEffects": false,
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite dev --port 3000",
8+
"dev:e2e": "vite dev",
9+
"build": "vite build",
10+
"start": "node .output/server/index.mjs",
11+
"prisma-generate": "prisma generate",
12+
"test:e2e": "exit 0; rm -rf port*.txt; pnpm run prisma-generate && playwright test --project=chromium"
13+
},
14+
"dependencies": {
15+
"@prisma/client": "5.22.0",
16+
"@tanstack/solid-router": "workspace:^",
17+
"@tanstack/solid-router-devtools": "workspace:^",
18+
"@tanstack/solid-start": "workspace:^",
19+
"prisma": "^5.22.0",
20+
"solid-js": "^1.9.5",
21+
"redaxios": "^0.5.1",
22+
"tailwind-merge": "^2.6.0",
23+
"vite": "^7.1.7"
24+
},
25+
"devDependencies": {
26+
"@playwright/test": "^1.50.1",
27+
"@tanstack/router-e2e-utils": "workspace:^",
28+
"@types/node": "^22.10.2",
29+
"vite-plugin-solid": "^2.11.9",
30+
"autoprefixer": "^10.4.20",
31+
"postcss": "^8.5.1",
32+
"tailwindcss": "^3.4.17",
33+
"typescript": "^5.7.2",
34+
"vite-tsconfig-paths": "^5.1.4"
35+
}
36+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import { defineConfig, devices } from '@playwright/test'
2+
import { getTestServerPort } from '@tanstack/router-e2e-utils'
3+
import packageJson from './package.json' with { type: 'json' }
4+
5+
const PORT = await getTestServerPort(packageJson.name)
6+
const baseURL = `http://localhost:${PORT}`
7+
/**
8+
* See https://playwright.dev/docs/test-configuration.
9+
*/
10+
export default defineConfig({
11+
testDir: './tests',
12+
workers: 1,
13+
14+
reporter: [['line']],
15+
16+
use: {
17+
/* Base URL to use in actions like `await page.goto('/')`. */
18+
baseURL,
19+
},
20+
21+
webServer: {
22+
command: `VITE_SERVER_PORT=${PORT} pnpm build && PORT=${PORT} VITE_SERVER_PORT=${PORT} pnpm start`,
23+
url: baseURL,
24+
reuseExistingServer: !process.env.CI,
25+
stdout: 'pipe',
26+
},
27+
28+
projects: [
29+
{
30+
name: 'chromium',
31+
use: { ...devices['Desktop Chrome'] },
32+
},
33+
],
34+
})
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export default {
2+
plugins: {
3+
tailwindcss: {},
4+
autoprefixer: {},
5+
},
6+
}
24 KB
Binary file not shown.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
-- CreateTable
2+
CREATE TABLE "User" (
3+
"email" TEXT NOT NULL PRIMARY KEY,
4+
"password" TEXT NOT NULL
5+
);
6+
7+
-- CreateIndex
8+
CREATE UNIQUE INDEX "User_email_key" ON "User"("email");
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Please do not edit this file manually
2+
# It should be added in your version-control system (i.e. Git)
3+
provider = "sqlite"
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// This is your Prisma schema file,
2+
// learn more about it in the docs: https://pris.ly/d/prisma-schema
3+
4+
generator client {
5+
provider = "prisma-client-js"
6+
}
7+
8+
datasource db {
9+
provider = "sqlite"
10+
url = env("DATABASE_URL")
11+
}
12+
13+
model User {
14+
email String @id @unique
15+
password String
16+
}

0 commit comments

Comments
 (0)