fix: add missing test case and fix double semicolon in screaming snake case challenge (#66458)

This commit is contained in:
Harshith Kumar
2026-03-16 00:34:52 +05:30
committed by GitHub
parent da0eea689e
commit 0fc80621fb
2 changed files with 16 additions and 1 deletions
@@ -55,6 +55,12 @@ assert.equal(toScreamingSnakeCase("user-address"), "USER_ADDRESS");
assert.equal(toScreamingSnakeCase("username"), "USERNAME");
```
`toScreamingSnakeCase("my_variable_name")` should return `"MY_VARIABLE_NAME"`.
```js
assert.equal(toScreamingSnakeCase("my_variable_name"), "MY_VARIABLE_NAME");
```
# --seed--
## --seed-contents--
@@ -73,6 +79,6 @@ function toScreamingSnakeCase(variableName) {
let temp = variableName.replace(/[-_]+/g, ' ');
temp = temp.replace(/([a-z0-9])([A-Z])/g, '$1 $2');
const words = temp.trim().split(/\s+/);
return words.join('_').toUpperCase();;
return words.join('_').toUpperCase();
}
```
@@ -70,6 +70,15 @@ TestCase().assertEqual(to_screaming_snake_case("username"), "USERNAME")`)
}})
```
`to_screaming_snake_case("my_variable_name")` should return `"MY_VARIABLE_NAME"`.
```js
({test: () => { runPython(`
from unittest import TestCase
TestCase().assertEqual(to_screaming_snake_case("my_variable_name"), "MY_VARIABLE_NAME")`)
}})
```
# --seed--
## --seed-contents--