question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tests pass with wrong code

See original GitHub issue

Challenge 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:closed
  • Created 7 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
QuincyLarsoncommented, Jun 17, 2017

@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.

1reaction
no-stack-dub-sackcommented, May 23, 2017

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found