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

18 lines
455 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', () => {
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'
)
})
})