mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-04-12 19:00:43 -04:00
fix(curriculum): forum leaderboard project step 61 - added test cases for test method solution (#54048)
This commit is contained in:
@@ -26,7 +26,7 @@ assert(code.match(/const\s+userAvatarUrl\s*=/));
|
||||
You should assign a `ternary` operator to the `userAvatarUrl`. Your `ternary` should check if `avatar` starts with `/user_avatar/` and return `avatarUrl.concat(avatar)` or `avatar`.
|
||||
|
||||
```js
|
||||
assert(code.match(/const\s+userAvatarUrl\s*=\s*avatar\.startsWith\(\s*('|")\/user_avatar\/\1\s*\)\s*\?\s*avatarUrl\.concat\(\s*avatar\s*\)\s*:\s*avatar\s*/));
|
||||
assert(code.match(/const\s+userAvatarUrl\s*=\s*(?:avatar\.startsWith\(\s*('|")\/user_avatar\/\1\s*\)|\/\^\\\/user_avatar\\\/\/\.test\(\s*avatar\s*\))\s*\?\s*avatarUrl\.concat\(\s*avatar\s*\)\s*:\s*avatar/));
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
Reference in New Issue
Block a user