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 if a Value Falls within a Specific Range - always fails

See original GitHub issue

Test if a Value Falls within a Specific Range

https://beta.freecodecamp.org/en/challenges/quality-assurance-and-testing-with-chai/test-if-a-value-falls-within-a-specific-range

Issue Description

The test always fails. It appears that there are two problems in /freeCodeCamp/seed/challenges/06-information-security-and-quality-assurance/quality-assurance-and-testing-with-chai.json:

  1. Test is checking unit test No. 10 but it should be No. 9 :
 "title": "Test if a Value Falls within a Specific Range",
...
...
"testString": "getUserInput => $.get(getUserInput('url') + '/_api/get-tests?type=unit&n=10')
... 

Here are the results to the get-tests glitch api, both with unit&n=9 and unit&n=10 query strings.

https://honeysuckle-crime.glitch.me/_api/get-tests?type=unit&n=10

{"title":"#isArray, #isNotArray","context":"Unit Tests -> Arrays","state":"failed","assertions":[{"method":"fail","args":["'isThisAnArray?'.split('')","'String.prototype.split() returns an Array'"]},{"method":"fail","args":["[1,2,3].indexOf(2)","'indexOf returns a number.'"]}]}

https://honeysuckle-crime.glitch.me/_api/get-tests?type=unit&n=9

{"title":"#isApproximately","context":"Unit Tests -> Comparisons","state":"passed","assertions":[{"method":"approximately","args":["weirdNumbers(0.5)","1","0.5"]},{"method":"approximately","args":["weirdNumbers(0.2)","1","0.8"]}]}

No. 10 is for the next challenge ( Test if Value is An Array )

  1. Test is checking for the assertion method “isApproximately” but it should be “approximately”

       `{  assert.equal(data.assertions[1].method, 'isApproximately'); ` 
    

Screenshot

image

I would be happy to tackle this one if FreeCodeCamp team agrees this is an issue.

Thank you.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
raisedadeadcommented, Feb 18, 2018

@Brybro sure thing, if you are ready please go ahead.

1reaction
iabrennecommented, Feb 18, 2018

@Brybro - I was planning on subbing a PR for this but unfortunately didn’t get a chance to. Don’t want to speak for @raisedadead but I’d say go for it! 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Test if a Value Falls within a Specific Range - Guide
Check the error outputs, and try to understand what the +/- values in the errors mean with respect to a possible range of...
Read more >
Checking if a value falls within a range which excludes a ...
I want to check the values in each Text column. The accepted range of values is from 1 to 10 (IMPORTANT: the range...
Read more >
If statement that tests if a value is in range? - Arduino Forum
Hi I am trying to write a code that tests if a value is within a range of values. For example, I record...
Read more >
How to return a value if lookup value is in a range
In this article, I will demonstrate four different formulas that allow you to lookup a value that is to be found in a...
Read more >
How to correct a #VALUE! error in the IF function
Unfortunately, because of the complexity with which IF statements can be built, it is fairly easy to run into the #VALUE! error. You...
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