Skip to content

Commit d18a2b1

Browse files
committed
🐛 Little fixes (see comment)
- Removed unused import in the website - Mock `console.error` in a test that's testing that the hook should throw
1 parent 494a535 commit d18a2b1

File tree

4 files changed

+5
-2
lines changed

4 files changed

+5
-2
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
![npm bundle size](https://img.shields.io/bundlephobia/minzip/usehooks-ts)
1919
![npm](https://img.shields.io/npm/v/usehooks-ts)<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
2020
[![All Contributors](https://img.shields.io/badge/all_contributors-253-orange.svg?style=flat-square)](#contributors-)
21+
2122
<!-- ALL-CONTRIBUTORS-BADGE:END -->
2223

2324
<br />

apps/www/src/app/layout.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import type { Metadata, Viewport } from 'next'
33
import { Inter as FontSans } from 'next/font/google'
44
import localFont from 'next/font/local'
55
import Script from 'next/script'
6-
import type { CSSProperties } from 'react'
76

87
import './globals.css'
98
import { BuyMeACoffee } from '@/components/buy-me-a-coffee'

packages/usehooks-ts/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
![npm bundle size](https://img.shields.io/bundlephobia/minzip/usehooks-ts)
1919
![npm](https://img.shields.io/npm/v/usehooks-ts)<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
2020
[![All Contributors](https://img.shields.io/badge/all_contributors-253-orange.svg?style=flat-square)](#contributors-)
21+
2122
<!-- ALL-CONTRIBUTORS-BADGE:END -->
2223

2324
<br />

packages/usehooks-ts/src/useBoolean/useBoolean.test.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,10 @@ describe('useBoolean()', () => {
8989

9090
it('should throw an error', () => {
9191
const nonBoolean = '' as never
92+
vi.spyOn(console, 'error').mockImplementation(() => vi.fn())
9293
expect(() => {
9394
renderHook(() => useBoolean(nonBoolean))
94-
}).toThrow('defaultValue must be `true` or `false`')
95+
}).toThrowError(/defaultValue must be `true` or `false`/)
96+
vi.resetAllMocks()
9597
})
9698
})

0 commit comments

Comments
 (0)