wip: code formatting nits continued

This commit is contained in:
jdalton
2023-09-16 22:59:56 -07:00
parent 0b28b7f7b6
commit b5c59317ea
421 changed files with 7354 additions and 9005 deletions

27
test/camelCase.spec.js Normal file
View File

@@ -0,0 +1,27 @@
import lodashStable from 'lodash';
import camelCase from '../src/camelCase';
describe('camelCase', () => {
it('should work with numbers', () => {
expect(camelCase('12 feet')).toBe('12Feet');
expect(camelCase('enable 6h format')).toBe('enable6HFormat');
expect(camelCase('enable 24H format')).toBe('enable24HFormat');
expect(camelCase('too legit 2 quit')).toBe('tooLegit2Quit');
expect(camelCase('walk 500 miles')).toBe('walk500Miles');
expect(camelCase('xhr2 request')).toBe('xhr2Request');
});
it('should handle acronyms', () => {
lodashStable.each(['safe HTML', 'safeHTML'], (string) => {
expect(camelCase(string)).toBe('safeHtml');
});
lodashStable.each(['escape HTML entities', 'escapeHTMLEntities'], (string) => {
expect(camelCase(string)).toBe('escapeHtmlEntities');
});
lodashStable.each(['XMLHttpRequest', 'XmlHTTPRequest'], (string) => {
expect(camelCase(string)).toBe('xmlHttpRequest');
});
});
});