Skip to content

Commit

Permalink
Test setup for todo project (#4)
Browse files Browse the repository at this point in the history
* Initialized next js project

* Test setup using vitest

* cleanup commit

* cleanup commit
  • Loading branch information
palakgupta2712 authored Nov 11, 2024
1 parent 464b3ac commit 73286bd
Show file tree
Hide file tree
Showing 4 changed files with 5,119 additions and 7 deletions.
8 changes: 8 additions & 0 deletions app/test/home.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { render } from "@testing-library/react";
import { expect, test } from "vitest";
import Home from "../page";

test("renders the homepage correctly", () => {
const { getByText } = render(<Home />);
expect(getByText("Hello World!")).toBeDefined();
});
23 changes: 16 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,30 @@
"dev": "next dev --turbopack",
"build": "next build",
"start": "next start",
"lint": "next lint"
"lint": "next lint",
"test": "vitest run",
"test:coverage": "vitest run --coverage",
"test:watch": "vitest"
},
"dependencies": {
"react": "19.0.0-rc-02c0e824-20241028",
"react-dom": "19.0.0-rc-02c0e824-20241028",
"next": "15.0.2"
"next": "15.0.2",
"react": "18.2.0",
"react-dom": "18.2.0"
},
"devDependencies": {
"typescript": "^5",
"@testing-library/dom": "^10.4.0",
"@testing-library/react": "^16.0.1",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"@vitejs/plugin-react": "^4.3.3",
"@vitest/coverage-v8": "2.1.4",
"eslint": "^8",
"eslint-config-next": "15.0.2",
"jsdom": "^25.0.1",
"postcss": "^8",
"tailwindcss": "^3.4.1",
"eslint": "^8",
"eslint-config-next": "15.0.2"
"typescript": "^5",
"vitest": "^2.1.4"
}
}
Loading

0 comments on commit 73286bd

Please sign in to comment.