mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 10:07:48 +00:00
wip: migrate to bun
This commit is contained in:
28
test/camelCase.spec.ts
Normal file
28
test/camelCase.spec.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import assert from 'node:assert';
|
||||
import lodashStable from 'lodash';
|
||||
import camelCase from '../src/camelCase';
|
||||
|
||||
describe('camelCase', () => {
|
||||
it('should work with numbers', () => {
|
||||
assert.strictEqual(camelCase('12 feet'), '12Feet');
|
||||
assert.strictEqual(camelCase('enable 6h format'), 'enable6HFormat');
|
||||
assert.strictEqual(camelCase('enable 24H format'), 'enable24HFormat');
|
||||
assert.strictEqual(camelCase('too legit 2 quit'), 'tooLegit2Quit');
|
||||
assert.strictEqual(camelCase('walk 500 miles'), 'walk500Miles');
|
||||
assert.strictEqual(camelCase('xhr2 request'), 'xhr2Request');
|
||||
});
|
||||
|
||||
it('should handle acronyms', () => {
|
||||
lodashStable.each(['safe HTML', 'safeHTML'], (string) => {
|
||||
assert.strictEqual(camelCase(string), 'safeHtml');
|
||||
});
|
||||
|
||||
lodashStable.each(['escape HTML entities', 'escapeHTMLEntities'], (string) => {
|
||||
assert.strictEqual(camelCase(string), 'escapeHtmlEntities');
|
||||
});
|
||||
|
||||
lodashStable.each(['XMLHttpRequest', 'XmlHTTPRequest'], (string) => {
|
||||
assert.strictEqual(camelCase(string), 'xmlHttpRequest');
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user