Skip to content

Commit

Permalink
Merge pull request #23 from andron13/vitest
Browse files Browse the repository at this point in the history
feat:vitest setup
  • Loading branch information
andron13 authored Sep 5, 2024
2 parents 82015a4 + 77fde7a commit 279aca4
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 7 deletions.
7 changes: 7 additions & 0 deletions app/__test__/sum.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { expect, test } from "vitest";

import { sum } from "./sum";

test("adds 1 + 2 to equal 3", () => {
expect(sum(1, 2)).toBe(3);
});
3 changes: 3 additions & 0 deletions app/__test__/sum.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export function sum(a: number, b: number): number {
return a + b;
}
77 changes: 72 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
"prepare": "husky",
"pre-commit": "lint-staged",
"ncu:check": "ncu",
"ncu:update": "ncu --interactive"
"ncu:update": "ncu --interactive",
"test": "vitest",
"coverage": "vitest run --coverage"
},
"dependencies": {
"@heroicons/react": "^2.1.5",
Expand Down Expand Up @@ -54,7 +56,7 @@
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react": "^7.35.0",
"eslint-plugin-react-compiler": "^0.0.0-experimental-b8a7b48-20240830",
"eslint-plugin-react-compiler": "^0.0.0-experimental-b8a7b48-20240903",
"eslint-plugin-react-hooks": "^5.1.0-rc.0",
"eslint-plugin-react-refresh": "^0.4.11",
"eslint-plugin-vitest": "^0.5.4",
Expand Down
9 changes: 9 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,16 @@ export default defineConfig({
v3_relativeSplatPath: true,
v3_throwAbortReason: true,
},
ignoredRouteFiles: ["**/*.css"],
}),
tsconfigPaths(),
],
test: {
globals: true,
environment: "jsdom",
// setupFiles: [""],
coverage: {
provider: "v8",
},
},
});

0 comments on commit 279aca4

Please sign in to comment.