Add pre commits

This commit is contained in:
Arthur Belleville 2025-04-10 07:43:57 +02:00
parent 1b5c56ca9b
commit 7d6ade4142
No known key found for this signature in database
6 changed files with 24 additions and 6 deletions

15
.pre-commit-config.yaml Normal file
View file

@ -0,0 +1,15 @@
repos:
- repo: local
hooks:
- id: test-ui
name: Test Frontend
entry: just test-frontend
language: python
pass_filenames: false
files: \.ts*
- id: typecheck
name: Typecheck Frontend
entry: just typecheck
language: python
pass_filenames: false
files: \.ts*

View file

@ -1 +0,0 @@
3.13

View file

@ -1,5 +1,11 @@
_frontend-dev:
cd ui && pnpm run dev
test-frontend:
cd ui && pnpm run test
typecheck:
cd ui && tsc -b
_backend-dev:
air -- -dev

View file

@ -9,7 +9,7 @@
"build": "tsc -b && vite build",
"lint": "eslint .",
"preview": "vite preview",
"test": "vitest",
"test": "vitest run",
"test:watch": "vitest watch",
"test:coverage": "vitest run --coverage"
},

View file

@ -1,10 +1,7 @@
import { screen, waitFor } from "@testing-library/react";
import { PublicRoute } from "@ui/components/PublicRoute";
import { Routes, Route } from "react-router-dom";
import {
SessionProvider,
SessionTestProvider,
} from "@ui/contexts/SessionContext";
import { SessionTestProvider } from "@ui/contexts/SessionContext";
import { renderWithRouter } from "@ui/utils/testHelpers";
describe("PublicRoute", () => {

View file

@ -22,6 +22,7 @@ export const PublicRoute = () => {
} else {
status = "should-pass";
}
return (
<>
{match(status)