Freecodecamp: Wherefore art thou could use more test cases.

Created on 23 Mar 2017  ·  4Comments  ·  Source: freeCodeCamp/freeCodeCamp

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.

help wanted

Most helpful comment

I can help with this issue. I will make a pull request shortly.

All 4 comments

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.

Was this page helpful?
0 / 5 - 0 ratings