All my tests are passing but FreeCodeCamp Website wont advance

Attached is what I’m seeing^^
When I run on glitch it says i’m passing all functional tests.
I have done this several different times today, changed my code multiple times, and I still don’t understand how this is happening?
I followed a YouTube Tutorial for the project so I know the code is correct, even with resetting my code.
I have my adblock turned off while using a private window on Google Chrome. What else can I do??
Please help!
Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 11_0_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.67 Safari/537.36.

Challenge: Stock Price Checker

Link to the challenge:

Please post the link to your project.

When did you first start this project? The latest starter boilerplate is on repl.it, not Glitch. I don’t think there have been any updates to the starter code but it might still be worth using the latest one anyway.

I wouldn’t be so sure of that. The requirements and tests might have been updated.

I started this project today! I copied the code from Github to Glitch, I even tried replicating my project on the repl boilerplate and still had the same issue.

Here is my glitch project, https://glitch.com/edit/#!/stockprice-checker

Thank you for responding. Let me know what I can do!

I’m sorry I can’t really help you right now, it’s super late for me. Hopefully, some else can help, otherwise, I will try when I have the time.

At least now we can see the project, so that’s good.

Welcome, jvumbaca.

The tests do not match the user story:

Here are the tests:

const data = await fetch(getUserInput('url') + '/api/stock-prices?stock=GOOG');
      const parsed = await data.json();
      const ticker = parsed.stockData;
      assert.typeOf(ticker.price, 'number');
      assert.typeOf(ticker.likes, 'number');
      assert.typeOf(ticker.stock, 'string');

Here is the response from the /api/stock-prices?stock=GOOG endpoint:

{"stockData":{"stock":"GOOG","price":"1768.88","likes":1}}

Can you see the problem?

Hope this helps

1 Like

@Sky020 I have gotten very little sleep, so my brain might just be stupid, but I don’t get it?

  • Why does it say “price (decimal in string format)” if it’s supposed to be a number?

  • What the live endpoint returns and the example on the page don’t seem to match.

Live return:

{"stockData":{"stock":"GOOG","price":1768.88,"likes":3}}

Example return:

{"stockData":{"stock":"GOOG","price":"786.90","likes":1}}

Does this challenge need to be updated, or what?

It seems like there was just a typo in the user-story. I assume the original intent was for the price to be a number (floating point), but got lost along the way :man_shrugging:

So, I would expect the behaviour the current example app produces is correct.

@nhcarrigan has a PR affecting the /learn file. So, I have commented requesting this change to be made: https://github.com/freeCodeCamp/freeCodeCamp/pull/40218#pullrequestreview-538375840

I would suggest we also fix the example responses on the example project page.

Where does the code for the site https://stock-price-checker.freecodecamp.rocks live?

Oh, is it here?

Edit: I made a PR

thank you Sky020 for the help and lasjorg, I understand what you both are saying, and hopefully this project and the rest that might still have typos are updated. Do we know if both of your pull requests were approved?

The mentioned PRs are still being QAed. Once one of the staff confirm which direction to go:
a) Change test to expect string
b) Change user story to mention number

Then, I see them being approved very quickly, and put into production the week after.

1 Like