Skip to content

Commit

Permalink
test: 更新单元测试
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyh2001 committed May 8, 2024
1 parent 4be156b commit 76358b1
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packages/fighting-design/_utils/type/__test__/utils.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { expect, test } from 'vitest'
import { toString } from '..'

test('toString', () => {
expect(toString(1)).toBe('[object Number]')
expect(toString('1')).toBe('[object String]')
expect(toString(true)).toBe('[object Boolean]')
expect(toString([])).toBe('[object Array]')
expect(toString({})).toBe('[object Object]')
expect(toString((): number => 1)).toBe('[object Function]')
expect(toString(new Date)).toBe('[object Date]')
expect(toString(Symbol(1))).toBe('[object Symbol]')
expect(toString(null)).toBe('[object Null]')
expect(toString(undefined)).toBe('[object Undefined]')
expect(toString(NaN)).toBe('[object Number]')
})

0 comments on commit 76358b1

Please sign in to comment.