diff --git a/Frontend/package.json b/Frontend/package.json index 6bf66f2..572c3d7 100644 --- a/Frontend/package.json +++ b/Frontend/package.json @@ -3,12 +3,14 @@ "private": true, "version": "0.0.0", "type": "module", - "scripts": { - "dev": "vite", - "build": "tsc -b && vite build", - "lint": "eslint .", - "preview": "vite preview" - }, +"scripts": { + "dev": "vite", + "build": "tsc -b && vite build", + "lint": "eslint .", + "preview": "vite preview", + "test": "vitest", + "test:run": "vitest run" +}, "dependencies": { "react": "^19.2.4", "react-dom": "^19.2.4", diff --git a/Frontend/src/hooks/__tests__/useAuth.test.tsx b/Frontend/src/hooks/__tests__/useAuth.test.tsx new file mode 100644 index 0000000..aac36fa --- /dev/null +++ b/Frontend/src/hooks/__tests__/useAuth.test.tsx @@ -0,0 +1,33 @@ +import { render, screen } from '@testing-library/react'; +import { AuthProvider } from '../useAuth'; +import { useAuth } from '../useAuth'; +import { ReactNode } from 'react'; + +// Test component that uses useAuth hook +const TestComponent = () => { + const auth = useAuth(); + return