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.

Test fails on "Only change the first line"

See original GitHub issue

Challenge subtract-one-number-from-another-with-javascript has an issue. User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36. Please describe how to reproduce this issue, and include links to screenshots if possible. This fails due to the difference in lines even if code has not been changed. It also fails when changing 0 to 33.



var difference = 45 - 0;



screen shot 2017-02-03 at 1 00 14 am screen shot 2017-02-03 at 12 59 49 am

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:23 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
hisenercommented, Feb 4, 2017

@erictleung It makes sense, then let’s make it 3 and add this test case to addition, multiplication and division challenges.

1reaction
erictleungcommented, Feb 3, 2017

This issue stems probably because the “solution” in the .json file is included in the code the regex checks (see similar discussion https://github.com/freeCodeCamp/freeCodeCamp/pull/11987#discussion_r92950694). The code is to check that you don’t just create another variable difference and assign it to 12. So I think it’s necessary. Just need to either remove the solution or change the test to check for two instances.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Java: test System output including "new lines" with assertEquals
A quick platform-independent solution can be to replace the line ... Then you can give a better problem description if the test fails....
Read more >
Simple tests pass in opened UI but fail on command line ...
Simple tests against web-app work, but when I run them in the headless mode, they fail and the error given is an application...
Read more >
Testing-library: avoid these mistakes in async tests
Sometimes, tests start to unexpectedly fail even if no changes were made to the business logic. It may happen after e.g. you updated...
Read more >
Testing in Go: Failing Tests - Ilija Eftimov ‍
Golang's testing package promotes two types of failures. The first failure type immediately stops the tests from running. And the second failure ...
Read more >
unittest — Unit testing framework — Python 3.11.1 ...
Changed in version 3.2: In earlier versions it was only possible to run individual test methods and not ... Stop the test run...
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