It seems that my code passes every test condition when I test it in the console, yet all but one of the tests are showing failure. Help?
See original GitHub issueChallenge Where do I belong has an issue.
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36
.
Please describe how to reproduce this issue, and include links to screenshots if possible.
My code:
function getIndexToIns(arr, num) {
arr.sort(function(a,b){return a-b;});
for(var i in arr){
if(arr[i]>=num){
return i;
}
}
return arr.length;
}
getIndexToIns([10, 20, 30, 40, 50], 35);
All parts of the challenge seem to be passed by the code above, yet almost all of the conditions are showing as failed.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Hide console logging for passing tests and show it for failures
A custom reporter can only show output for the suite (i.e. a test file), not a specific failing test.
Read more >Tests not running in Test Explorer - visual studio
However, the tests are not running when using the Visual Studio test explorer. The Test Explorer is showing all unit tests, but once...
Read more >Why do Apex Unit Test CLASSES sometimes FAIL when all ...
i.e. the tests methods pass, but then an exception happens when cleaning up, storing code coverage, setting values on the test result object, ......
Read more >Why tests pass locally but fail in Jenkins | Object Partners
The first thing you want to do is determine the source(s) of your leak (the data that is persisting into other test cases)....
Read more >Troubleshooting Your Solution | The Codewars Docs
Your solution seems to work or is close to working, but still fails tests ... “TEST”, only sample tests are run – the...
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
@bduncan136 Your function is returning a string instead of a number. That’s probably the problem.
Please proceed on the chat or the forum, this tracker is not for coding assistance.