Skip to content

Instantly share code, notes, and snippets.

@trikitrok
Created July 18, 2025 17:23
Show Gist options
  • Save trikitrok/099a90329d42ec7cb0891c16bba23e7d to your computer and use it in GitHub Desktop.
Save trikitrok/099a90329d42ec7cb0891c16bba23e7d to your computer and use it in GitHub Desktop.
describe('case insensitive word to key', () => {
test.each([
["A", "a"],
["Hello", "hello"],
["WORLD", "world"],
["MiXeDcAsE", "mixedcase"],
["PiPa", "pipa"],
["CHACHA", "chacha"],
["Hello123", "hello123"],
[" Space ", " space "],
["Special!@#", "special!@#"],
["üPPERCASE", "üppercase"],
])('converts %s to key %s', (word, expectedKey) => {
const wordToKey = new CaseInsensitiveWordToKey();
const result = wordToKey.getKey(word);
expect(result).toEqual(expectedKey);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment