freeCodeCamp: Test fails on "Only change the first line"
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;
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 23 (14 by maintainers)
Commits related to this issue
- fix(challenges): Fix 'only subtract one number' test BREAKING CHANGE: None Closes #13103 — committed to fccSeniorSeminar/freeCodeCamp by rcohane 7 years ago
- fix(challenges): Fix 'only subtract one number' test (#16173) Closes #13103 — committed to freeCodeCamp/freeCodeCamp by rcohane 7 years ago
- fix(challenges): Fix 'only subtract one number' test (#16173) Closes #13103 — committed to mhatout/freeCodeCamp by rcohane 7 years ago
- chore(release): 1.0.0 [skip ci] # 1.0.0 (2018-06-13) ### Bug Fixes * **cert-settings:** Uncouple Cert-Settings from dashedName's ([fda1be8](https://github.com/freeCodeCamp/curriculum/commit/fda1be8... — committed to ValeraS/freeCodeCamp by semantic-release-bot 6 years ago
@erictleung It makes sense, then let’s make it 3 and add this test case to addition, multiplication and division challenges.
This issue stems probably because the “solution” in the
.jsonfile 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 variabledifferenceand 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.@dnahol The previous challenge, Add Two Numbers, doesn’t have a test case like this one. These two challenges look like very similar. I think it’s ok.