mirror of
https://github.com/element-plus/element-plus.git
synced 2025-12-19 09:09:40 +08:00
* feat: support node 18+ & update tsx and vitest * chore: update * chore: remove * fix: update dep * test: fix autocomplete * test: update * test: update * chore: update * chore: update * chore: update
31 lines
804 B
TypeScript
31 lines
804 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)
|
|
})
|
|
})
|