Tests pass with wrong code
See original GitHub issueChallenge use-destructuring-assignment-to-pass-an-object-as-a-functions-parameters has an issue.
User Agent is: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36
.
Please describe how to reproduce this issue, and include links to screenshots if possible.
The following passes. Code doesn’t have bugs, but also doesn’t properly follow the instructions.
const stats = {
max: 56.78,
standard_deviation: 4.34,
median: 34.54,
mode: 23.87,
min: -0.75,
average: 35.85
};
/* Alter code below this line */
const {max, min} = stats
const half = (max, min) => (max + min) / 2.0; // use function argument destructurung
/* Alter code above this line */
console.log(stats); // should be object
console.log(half(stats)); // should be 28.015
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
How to correct a mistake in the test, after writing implementation
I like this answer best: It's important to see the test fail with incorrect code, so I would delete/comment out the code, correct...
Read more >Should all of my unit tests always pass when method is given ...
The unit tests in group A fail when the method is given invalid input since the method needs valid input to return correctly....
Read more >I am getting the correct output, but I didn't pass the test case in ...
May be while coding you are just checking for that sample output, might be your code holds true for sample output but fails...
Read more >Where is error in my code . test cases pass but sumitted ...
Where is error in my code . test cases pass but sumitted answer is wrong ... Exception { // your code goes here...
Read more >I encountered Wrong Answer/Runtime Error for a specific test ...
I encountered Wrong Answer/Runtime Error for a specific test case. When I test my code using this test case, it produced the correct...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@no-stack-dub-sack I’m confident we’ll be able to fill in these tests pretty quickly once @Berkeleytrue ships his layout fixes and we can run D3, React, ES6, and other tools on beta. Until that point, it’s hard to create and test new tests.
@systimotic - do we know if anyone is working on writing tests for these? It looks like the entire ES6 section needs either formatting or test cases to be written. At least 16 of the challenges have zero or only partial tests written. The others are not in the correct test case format.
We may be limited on how we test some of these, but most can be tested using deep equality methods and regex.EDIT: I was wrong about this, we still cannot test these challenges.@QuincyLarson - I know you mentioned you felt we were pretty close to shipping beta once Berkeley finished up with some of the major architectural changes - were you aware that there are still entire sections like this that have challenges that have not yet been completed? After our call today, and looking through the beta curriculum, I think there is quite a bit left to do with the existing material, making me wonder if now is the best time to introduce anything else significant to a curriculum that we are already struggling to keep up with QAing and preparing for shipping to prod.