Skip to content

Commit

Permalink
test(m): kebab-case helper
Browse files Browse the repository at this point in the history
  • Loading branch information
aidenybai committed Sep 7, 2021
1 parent 20f1e1b commit 857f4aa
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/__test__/m.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { className, DELETE, INSERT, m, ns, style, svg, UPDATE } from '../m';
import { className, DELETE, INSERT, kebab, m, ns, style, svg, UPDATE } from '../m';
import { VDeltaOperationTypes } from '../structs';

describe('.m', () => {
Expand Down Expand Up @@ -208,4 +208,12 @@ describe('.m', () => {
expect(DELETE()).toEqual([VDeltaOperationTypes.DELETE, 0]);
expect(DELETE(5)).toEqual([VDeltaOperationTypes.DELETE, 5]);
});

it('should convert camelCase to kebab-case', () => {
expect(kebab({ fooBarBaz: 'fooBarBaz' })).toEqual({ 'foo-bar-baz': 'fooBarBaz' });
expect(kebab({ helloWorld: 'helloWorld' })).toEqual({ 'hello-world': 'helloWorld' });
expect(kebab({ iHaveNumbers1: 'iHaveNumbers1' })).toEqual({
'i-have-numbers1': 'iHaveNumbers1',
});
});
});

0 comments on commit 857f4aa

Please sign in to comment.