详细说明: - 添加了V2版本的工作流页面和结果页面 - 更新了Serena记忆文件 - 添加了详细实施计划文档 - 优化了Vite配置 - 更新了项目文档CLAUDE.md - 构建了演示系统的dist版本 - 包含了exhibition-demo的完整依赖
63 lines
1.8 KiB
TypeScript
63 lines
1.8 KiB
TypeScript
import { camelCase } from './utilities';
|
|
|
|
describe('camelCase', () => {
|
|
it('returns "" for empty string', () => {
|
|
expect(camelCase('')).toBe('');
|
|
});
|
|
|
|
// no hyphen
|
|
it.each([
|
|
['foo', 'foo'],
|
|
['fooBar', 'fooBar'],
|
|
])('does not transform "%s"', (property, expected) => {
|
|
expect(camelCase(property)).toBe(expected);
|
|
});
|
|
|
|
// custom property
|
|
it.each([
|
|
['--fooBar', '--fooBar'],
|
|
['--foo-bar', '--foo-bar'],
|
|
['--foo-100', '--foo-100'],
|
|
['--test_ing', '--test_ing'],
|
|
])('does not transform custom property "%s"', (property, expected) => {
|
|
expect(camelCase(property)).toBe(expected);
|
|
});
|
|
|
|
// vendor prefix
|
|
it.each([
|
|
['-khtml-transition', 'khtmlTransition'],
|
|
['-moz-user-select', 'mozUserSelect'],
|
|
['-ms-transform', 'msTransform'],
|
|
['-ms-user-select', 'msUserSelect'],
|
|
['-o-transition', 'oTransition'],
|
|
['-webkit-transition', 'webkitTransition'],
|
|
['-webkit-user-select', 'webkitUserSelect'],
|
|
])('transforms vendor prefix "%s" to "%s"', (property, expected) => {
|
|
expect(camelCase(property)).toBe(expected);
|
|
});
|
|
|
|
it.each([
|
|
['foo-bar', 'fooBar'],
|
|
['foo-bar-baz', 'fooBarBaz'],
|
|
['CAMEL-CASE', 'camelCase'],
|
|
])('transforms "%s" to "%s"', (property, expected) => {
|
|
expect(camelCase(property)).toBe(expected);
|
|
});
|
|
|
|
describe('option reactCompat is true', () => {
|
|
const options = { reactCompat: true };
|
|
|
|
it.each([
|
|
['-khtml-transition', 'KhtmlTransition'],
|
|
['-o-transition', 'OTransition'],
|
|
['-moz-user-select', 'MozUserSelect'],
|
|
['-ms-transform', 'msTransform'],
|
|
['-ms-user-select', 'msUserSelect'],
|
|
['-webkit-transition', 'WebkitTransition'],
|
|
['-webkit-user-select', 'WebkitUserSelect'],
|
|
])('capitalizes vendor prefix "%s" to "%s"', (property, expected) => {
|
|
expect(camelCase(property, options)).toBe(expected);
|
|
});
|
|
});
|
|
});
|