vue3-yuanma/packages/shared/__tests__/normalizeProp.spec.ts

20 lines
467 B
TypeScript
Raw Normal View History

import { normalizeClass } from '../src'
describe('normalizeClass', () => {
test('handles string correctly', () => {
expect(normalizeClass('foo')).toEqual('foo')
})
test('handles array correctly', () => {
2021-07-20 06:24:18 +08:00
expect(normalizeClass(['foo', undefined, true, false, 'bar'])).toEqual(
'foo bar'
)
})
test('handles object correctly', () => {
expect(normalizeClass({ foo: true, bar: false, baz: true })).toEqual(
'foo baz'
)
})
})