Freecodecamp: Test if a Value Falls within a Specific Range - always fails

Created on 8 Feb 2018  路  7Comments  路  Source: freeCodeCamp/freeCodeCamp

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 )

2) 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.

help wanted learn

All 7 comments

@iabrenne sure, please go ahead. and thanks for reporting.

@raisedadead - Is this issue assigned or open to be worked on?

@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! :)

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

@iabrenne @raisedadead - Since I am new to this project, do you mind explaining how I can go about producing this bug?

@Brybro - sorry for the delay in responding, but looks like you have figured it out :+1:

@Em-Ant Since you helped design and implement this challenge, could you take a look at this and see whether @Brybro's PR elegantly fixes this issue?

Was this page helpful?
0 / 5 - 0 ratings