Skip to content

Commit 3f7227f

Browse files
committed
test(core): add test cases for the hook
1 parent 3ffda40 commit 3f7227f

10 files changed

Lines changed: 6432 additions & 6852 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ node_modules
99

1010
# Generate output
1111
dist
12+
coverage
1213

1314
# Stores VSCode versions used for testing VSCode extensions
1415
.vscode-test

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
.vscode
44
build
55
dist
6+
coverage
67
node_modules
78
public
89
.github

.vscode/settings.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"eslint.validate": [
3+
"javascript",
4+
"javascriptreact",
5+
"typescript",
6+
"typescriptreact"
7+
],
8+
"typescript.tsdk": "node_modules/typescript/lib",
9+
}

package.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,27 @@
1313
"@semantic-release/github": "^12.0.3",
1414
"@semantic-release/npm": "^13.1.3",
1515
"@semantic-release/release-notes-generator": "^14.1.0",
16+
"@testing-library/react": "^16.3.0",
1617
"@types/react": "^19.2.10",
1718
"@typescript-eslint/eslint-plugin": "^8.54.0",
1819
"@typescript-eslint/parser": "^8.54.0",
20+
"@vitest/coverage-v8": "^2.1.9",
1921
"eslint": "^9.39.2",
2022
"eslint-config-prettier": "^10.1.8",
2123
"eslint-plugin-prettier": "^5.5.5",
2224
"eslint-plugin-react-hooks": "^7.0.1",
2325
"husky": "^9.1.7",
26+
"jsdom": "^27.4.0",
2427
"lint-staged": "^16.2.7",
2528
"prettier": "^3.8.1",
2629
"prettier-plugin-organize-imports": "^4.3.0",
30+
"react": "^19.2.4",
31+
"react-dom": "^19.2.4",
2732
"semantic-release": "^25.0.3",
2833
"typescript": "^5.9.3",
2934
"vite": "^7.3.1",
30-
"vite-plugin-dts": "^4.5.4"
35+
"vite-plugin-dts": "^4.5.4",
36+
"vitest": "^2.1.9"
3137
},
3238
"engines": {
3339
"node": ">=22.14.0"
@@ -92,6 +98,9 @@
9298
"prepare": "if [ \"$NODE_ENV\" != \"production\" ]; then husky; fi",
9399
"setup": "pnpm install && husky",
94100
"release": "semantic-release",
101+
"test": "vitest run",
102+
"test:watch": "vitest",
103+
"test:coverage": "vitest run --coverage",
95104
"typecheck:main": "tsc -b .",
96105
"typecheck:playground": "pnpm build && pnpm -C playground exec tsc -p tsconfig.json",
97106
"typecheck": "pnpm typecheck:main && pnpm typecheck:playground",

0 commit comments

Comments
 (0)