Information Security Projects - Stock Price Checker

Tell us what’s happening:

I created my route handlers and they are all pass.
Only need to pass item 7 left.
I created the first 3 functionality tests but I am stuck on a weird problem:
When I run the code with npm run start:

  • Only the first functionality test is PASS.
  • It doesnt move to the 2nd test, it is stuck there.
  • But I can make several requests to the server and get the expected package.

I tried to simplify the route or tests and put a bunch of console logs but still stuck with the same problem.
Also confirmed my .env is good with the test in Node Env.
###Your project link(s)

solution: http://localhost:3000
my repo: GitHub - Inf3st4toR/InfoSec_Practice_Project: A boilerplate for a freeCodeCamp project.

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36

Challenge Information:

Information Security Projects - Stock Price Checker

I am replying to my own issue. Hope it will help others.
I have been doing some investigation with the help of AI and I fixed this issue.

Issue had to do with my fetch function that wasn’t imported properly, but then more issues happened and I had to change my fetch module to be compatible with the current Node version:

// in Bash:
npm uninstall node-fetch
npm install node-fetch@2
// added this to my route:
const fetch = require(‘node-fetch’);

Now my code is running.