Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vainjs/hooks",
"version": "0.0.1",
"version": "0.0.2",
"description": "a silky react hooks library",
"types": "dist/es/types/index.d.ts",
"module": "dist/es/index.mjs",
Expand All @@ -18,7 +18,6 @@
},
"type": "module",
"sideEffects": false,
"packageManager": "pnpm@8.10.5",
"engines": {
"node": ">=16.0.0",
"pnpm": ">=8.10.5"
Expand Down Expand Up @@ -51,13 +50,13 @@
"@commitlint/config-conventional": "^17.6.0",
"@rollup/plugin-terser": "^0.4.3",
"@rollup/plugin-typescript": "^11.1.0",
"@testing-library/react": "^16.0.0",
"@testing-library/react": "^14.0.0",
"@testing-library/dom": "^8.0.0",
"@types/jest": "^29.5.0",
"@types/node": "^18.15.11",
"@types/react": "^18.0.33",
"@types/react": "^18.3.22",
"@typescript-eslint/eslint-plugin": "^6.5.0",
"@typescript-eslint/parser": "^6.5.0",
"antd": "^5.6.3",
"eslint": "^8.48.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^9.0.0",
Expand All @@ -71,13 +70,14 @@
"lint-staged": "^13.2.1",
"prettier": "^3.0.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rollup": "^3.21.0",
"rollup-plugin-clear": "^2.0.7",
"ts-jest": "^29.2.4",
"typescript": "^5.0.4"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
},
"commitlint": {
"extends": [
Expand Down
14 changes: 7 additions & 7 deletions packages/usePagination/__tests__/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { RenderHookResult, renderHook, act } from '@testing-library/react'
import { waitFor } from '@testing-library/react'
import { Response, useAntdPagination } from '../index'
import { Response, usePagination } from '../index'

type Result = ReturnType<typeof useAntdPagination>
type Result = ReturnType<typeof usePagination>

const response = { total: 100, list: [{ a: 1 }, { a: 2 }, { a: 3 }] }

Expand All @@ -13,12 +13,12 @@ const mockApi = (): Promise<Response> =>
}, 10)
})

describe('useAntdPagination', () => {
describe('usePagination', () => {
let hook: RenderHookResult<Result, any>

it('useAntdPagination should work', async () => {
it('usePagination should work', async () => {
act(() => {
hook = renderHook(() => useAntdPagination({ request: mockApi }))
hook = renderHook(() => usePagination({ request: mockApi }))
})
expect(hook.result.current.loading).toBe(true)
expect(hook.result.current.pagination.total).toBe(0)
Expand All @@ -32,9 +32,9 @@ describe('useAntdPagination', () => {
})

let last: Result
it('useAntdPagination export methods keep immutable', () => {
it('usePagination export methods keep immutable', () => {
act(() => {
hook = renderHook(() => useAntdPagination({ request: mockApi }))
hook = renderHook(() => usePagination({ request: mockApi }))
})
last = hook.result.current

Expand Down
Loading