freeCodeCamp / curriculum

The freeCodeCamp curriculum and lesson editor
Creative Commons Attribution Share Alike 4.0 International
81 stars 124 forks source link

fix(challenges): reword test text and improve test accuracy #293

Closed ojeytonwilliams closed 5 years ago

ojeytonwilliams commented 5 years ago

Description

The challenge ES6: Use Destructuring Assignment with the Rest Operator to Reassign Array Elements, had slightly odd test descriptions and the tests didn't quite capture what they should. For example, if the user did not use a destructuring operator they'd be told 'destructuring was used.'. Also, the tests passed and failed some things they shouldn't. As mentioned in #281, returning an empty array would pass the first test. The second test required the use of the variable arr, which is not strictly necessary. Finally the third test would only fail if it found 'Array.slice' in the editor, but would pass let arr = list.slice(2).

This PR addresses those issue by slightly tweaking the text and tightening/relaxing the tests, as appropriate.

Checklist:

Closes #281

scissorsneedfoodtoo commented 5 years ago

Awesome! Everything LGTM :+1: :+1:

Thank you for taking the time to improve this challenge, @ojeytonwilliams. Looking forward to your next contribution!