diff --git a/bun.lockb b/bun.lockb index 650db5c..5717637 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/commitlint.config.mjs b/commitlint.config.mjs index fa584fb..fba73fb 100644 --- a/commitlint.config.mjs +++ b/commitlint.config.mjs @@ -1 +1 @@ -export default { extends: ["@commitlint/config-conventional"] }; +export default { extends: ["@commitlint/config-conventional"] } diff --git a/package.json b/package.json index 7352518..e3d7563 100644 --- a/package.json +++ b/package.json @@ -1,33 +1,16 @@ { "name": "zustand-computed", "version": "1.4.1", - "description": "A Zustand middleware to create computed states.", "author": "chrisvander", - "license": "MIT", + "repository": "chrisvander/zustand-computed", "main": "dist/index.js", "module": "dist/index.mjs", - "exports": { - ".": { - "import": "./dist/index.js", - "require": "./dist/index.mjs" - } - }, - "repository": "chrisvander/zustand-computed", - "files": [ - "/dist" - ], - "scripts": { - "check": "biome check --write", - "format": "biome format --write", - "lint": "biome lint", - "build": "vite build" - }, "devDependencies": { "@biomejs/biome": "^1.8.3", "@commitlint/cli": "^19.4.0", "@commitlint/config-conventional": "^19.2.2", - "@tsconfig/recommended": "^1.0.7", - "@types/jest": "^29.5.12", + "@tsconfig/bun": "^1.0.7", + "@types/bun": "^1.1.6", "@types/node": "^22.5.0", "husky": "^9.1.5", "react": "^18.3.1", @@ -41,18 +24,20 @@ "react": "^18.2.0", "zustand": "^4.3.8" }, - "keywords": [ - "zustand", - "computed", - "calculated", - "state", - "react", - "plugin", - "middleware", - "npm", - "typescript" - ], - "dependencies": { - "@tsconfig/bun": "^1.0.7" + "exports": { + ".": { + "import": "./dist/index.js", + "require": "./dist/index.mjs" + } + }, + "description": "A Zustand middleware to create computed states.", + "files": ["/dist"], + "keywords": ["zustand", "computed", "calculated", "state", "react", "plugin", "middleware", "npm", "typescript"], + "license": "MIT", + "scripts": { + "check": "biome check --write", + "format": "biome format --write", + "lint": "biome lint", + "build": "vite build" } } diff --git a/src/computed.test.ts b/src/computed.test.ts index 647b586..5980562 100644 --- a/src/computed.test.ts +++ b/src/computed.test.ts @@ -1,3 +1,4 @@ +import { describe, expect, test, beforeEach, mock } from "bun:test" import { type StateCreator, create } from "zustand" import { type ComputedStateOpts, computed } from "./computed" @@ -28,7 +29,7 @@ function computeState(state: Store): ComputedStore { } describe("default config", () => { - const computeStateMock = jest.fn(computeState) + const computeStateMock = mock(computeState) const makeStore = () => create( computed( @@ -45,7 +46,7 @@ describe("default config", () => { let useStore: ReturnType beforeEach(() => { - jest.clearAllMocks() + computeStateMock.mockClear() useStore = makeStore() }) @@ -86,7 +87,7 @@ describe("default config", () => { }) describe("custom config", () => { - const computeStateMock = jest.fn(computeState) + const computeStateMock = mock(computeState) const makeStore = (opts?: ComputedStateOpts) => create( computed( @@ -147,7 +148,7 @@ function computeSlice(state: CountSlice): ComputedStore { } describe("slices pattern", () => { - const computeSliceMock = jest.fn(computeSlice) + const computeSliceMock = mock(computeSlice) const makeStore = () => { const createCountSlice: StateCreator< Store,