Backend and frontend testing stacks (pytest + vitest) and a few initial tests.

This commit is contained in:
2026-02-27 16:03:06 +03:00
parent 46af911a06
commit be2590d7f7
10 changed files with 104 additions and 2 deletions
+7 -2
View File
@@ -6,7 +6,8 @@
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
"preview": "vite preview",
"test": "vitest"
},
"dependencies": {
"react": "^18.2.0",
@@ -14,6 +15,10 @@
},
"devDependencies": {
"@vitejs/plugin-react": "^4.2.0",
"vite": "^5.0.0"
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "^14.2.1",
"jsdom": "^24.0.0",
"vite": "^5.0.0",
"vitest": "^1.3.1"
}
}
+12
View File
@@ -0,0 +1,12 @@
import { render, screen } from "@testing-library/react";
import App from "./App.jsx";
describe("App", () => {
it("renders the hero copy", () => {
render(<App />);
expect(
screen.getByText("Find, compare, and book top salons near you.")
).toBeInTheDocument();
});
});
+1
View File
@@ -0,0 +1 @@
import "@testing-library/jest-dom";
+4
View File
@@ -7,5 +7,9 @@ export default defineConfig({
proxy: {
"/api": "http://localhost:8000"
}
},
test: {
environment: "jsdom",
setupFiles: "./src/test/setupTests.js"
}
});