Challenge Wherefore art thou seems lacking in test cases for invalid input. I would think that
whatIsInAName([{ "a": 1, "b": 2, "c": 3}], { "a": 1, "b": 9999, "c": 3})
ought to return an empty array, for instance. There is currently no check for this, so my code which returns
{ "a": 1, "b": 2, "c": 3}
passes all test cases.
Good catch. Your code doesn't pass the beta version though: https://beta.freecodecamp.com/en/challenges/intermediate-algorithm-scripting/wherefore-art-thou
so that's an improvement.
I'll investigate to see if we can make a PR against master branch.
@skylarjhdownes sounds like a valid addition to the tests. But we'll also need to add that additional requirement into the instructions.
@JoolsMcFly if changes are made, they can just go to staging
.
cc/ @freeCodeCamp/moderators second thoughts? If the input for source
is invalid, just return an empty array?
I'm on board with that 👍
I can help with this issue. I will make a pull request shortly.
Most helpful comment
I can help with this issue. I will make a pull request shortly.