From 76358b1c09d5a056ee4ef8dd4cefcd82e786e598 Mon Sep 17 00:00:00 2001 From: Tyh2001 <1469442737@qq.com> Date: Wed, 8 May 2024 20:12:11 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E6=9B=B4=E6=96=B0=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_utils/type/__test__/utils.spec.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 packages/fighting-design/_utils/type/__test__/utils.spec.ts diff --git a/packages/fighting-design/_utils/type/__test__/utils.spec.ts b/packages/fighting-design/_utils/type/__test__/utils.spec.ts new file mode 100644 index 0000000000..13d72bbe1c --- /dev/null +++ b/packages/fighting-design/_utils/type/__test__/utils.spec.ts @@ -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]') +})