Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mrashed-dev committed Mar 4, 2024
1 parent 4caafac commit 267380f
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,22 @@ describe('convertCase', () => {
user_age: undefined,
});
});

it('should handle numerical key names in snake_case conversion', () => {
const obj = { firstName: 'John', current2024Status: 'confirmed' };
const result = objKeysToSnakeCase(obj);
expect(result).toEqual({
first_name: 'John',
current_2024_status: 'confirmed',
});
});

it('should handle numerical key names in camelCase conversion', () => {
const obj = { first_name: 'John', current_2024_status: 'confirmed' };
const result = objKeysToCamelCase(obj);
expect(result).toEqual({
firstName: 'John',
current2024Status: 'confirmed',
});
});
});

0 comments on commit 267380f

Please sign in to comment.