vue3-yuanma/packages/shared/__tests__/normalizeProp.spec.ts
2021-07-19 18:24:18 -04:00

20 lines
467 B
TypeScript

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'
)
})
})