mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-14 09:20:51 +08:00
c4d0c6f90a
Co-authored-by: 三咲智子 <sxzz@sxzz.moe>
31 lines
816 B
TypeScript
31 lines
816 B
TypeScript
import * as vueShared from '@vue/shared'
|
|
import { describe, expect, it } from 'vitest'
|
|
import {
|
|
camelize,
|
|
capitalize,
|
|
escapeStringRegexp,
|
|
hyphenate,
|
|
kebabCase,
|
|
} from '..'
|
|
|
|
describe('strings', () => {
|
|
it('escapeStringRegexp should work', () => {
|
|
expect(escapeStringRegexp('foo')).toMatchInlineSnapshot('"foo"')
|
|
expect(escapeStringRegexp('**\\//aa^~#$')).toMatchInlineSnapshot(
|
|
'"\\\\*\\\\*\\\\\\\\//aa\\\\^~#\\\\$"'
|
|
)
|
|
})
|
|
|
|
it('capitalize', () => {
|
|
;['capitalize', 'camelize', 'hyphenate'].forEach((item) => {
|
|
expect(capitalize(item)).toBe(vueShared.capitalize(item))
|
|
})
|
|
})
|
|
|
|
it('re-export from @vue/shared', () => {
|
|
expect(camelize).toBe(vueShared.camelize)
|
|
expect(hyphenate).toBe(vueShared.hyphenate)
|
|
expect(kebabCase).toBe(vueShared.hyphenate)
|
|
})
|
|
})
|