"Test runner failed"

Hi @Sky020 after some hours of digging I was able to figure out what the exact issue is & narrowed it down to 2 places.

I also took a look at this thread Test Runner Failed - Learn Bash Scripting by Building Five Programs - Backend Development - The freeCodeCamp Forum

I was able to run this project both with & without docker, same issue in both places.

npm install not running

The code road extension is failing to properly setup the project, it changes the directory to /freeCodeCamp but fails to run npm install, which causes .mocharc.json & node_modules/ directory to not be there, essentially failing the tests.

To fix this I had to follow the above thread & @hbar1st 's instructions to manually add the .mocharc.json & install all the npm packages.

Code Road fails to update current level

After this step I’m able to run & progress levels in the course but I noticed that even if I don’t follow the level’s instructions It would still pass the test?

I take a look and found that .mocharc.json has a "spec" property which should be updated with every level you pass. This wasn’t updating
I tried somethings to make it update but it was still not auto-updating.

Only solution is to manually update the "spec" property of .mocharc.json file. (Which is tedious imo)
I do not know if this issue is with Code runner, FCC’s course or the docker container.

My machine specs: Windows 11 - Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz 2.10 GHz | 64-bit operating system, x64-based processor

Any idea what could be causing this? How can we make the code road update the tests automatically?

1 Like