diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..a5a27d9 --- /dev/null +++ b/.pre-commit-config.yaml @@ -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* diff --git a/.python-version b/.python-version deleted file mode 100644 index 24ee5b1..0000000 --- a/.python-version +++ /dev/null @@ -1 +0,0 @@ -3.13 diff --git a/justfile b/justfile index 20d3c7c..ccf0bfe 100644 --- a/justfile +++ b/justfile @@ -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 diff --git a/ui/package.json b/ui/package.json index 799516f..ee9c07f 100644 --- a/ui/package.json +++ b/ui/package.json @@ -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" }, diff --git a/ui/src/components/PublicRoute.test.tsx b/ui/src/components/PublicRoute.test.tsx index 030c6e6..9598874 100644 --- a/ui/src/components/PublicRoute.test.tsx +++ b/ui/src/components/PublicRoute.test.tsx @@ -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", () => { diff --git a/ui/src/components/PublicRoute.tsx b/ui/src/components/PublicRoute.tsx index 83c2fcc..5f16e2e 100644 --- a/ui/src/components/PublicRoute.tsx +++ b/ui/src/components/PublicRoute.tsx @@ -22,6 +22,7 @@ export const PublicRoute = () => { } else { status = "should-pass"; } + return ( <> {match(status)