Sudoku Solver wont submit despite tests passing

Tell us what’s happening:
Describe your issue in detail here.

Hello, I have been working on the sudoku solver project and finally got it where I want it. When I go to submit the project the only 2 failing qualifications are that both my unit and functional tests are not passing but when i run ‘npm run test’ it says they all pass. Upon looking for a solution I found that some people who encountered the same problem were not using assertions. So I went back and verified that I was using assertions so its not that. The only thing I can think of it being is that FCCs tests check that you are using the puzzle strings within puzzle-strings.js.

Side Note: very unlikely but I am using Firefox which most other devs that had the same problem were using. Maybe browser related?

Any help/suggestions would be great as I have no way to tell why my project cant be submitted despite saying its tests pass. :sweat_smile:

Your project link(s)

solution: boilerplate-project-sudoku-solver-1 - Replit

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:101.0) Gecko/20100101 Firefox/101.0

Challenge: Sudoku Solver

Link to the challenge:

So upon further investigation in trying to get this fixed I ran across this in ‘fcctesting.js’ in the routes dir.

if(process.env.NODE_ENV === 'test') return next();
    res.json({status: 'unavailable'});

It stuck out to me since everytime I try and submit my project my console was spitting out these errors:

I am at a loss. My node_env is already set to test so shouldn’t it return to the next function and not return { status: ‘unavailable’ }?

Any input or recommendations would be greatly appreciated :sweat_smile: . Right now I am at a loss as I feel I have tried everything to no avail. :face_with_raised_eyebrow:

I will try and upload a github repo of the projects code tomorrow if anyone wants to have a look.

I fixed it. :confetti_ball: :partying_face: :tada:
It was that line of code in ‘fcctesting.js’.

if (process.env.NODE_ENV === 'test') return next();

Found out that the NODE_ENV was undefined. I was on Repl.it and you have to add your environment variables on the sidebar and not in the sample.env file.

Hope this helps anyone in the future save some time.

Maybe FCC should add a note in the project page for any app that requires env variables. That they need to do it in the sidebar of the REPL platform and not use the .env file. For their testing purposes at least.

ok peace :slight_smile: :v:

1 Like