I am almost done with this Metric-Imperial Converter project but I have problem with the last two tests:
All 16 unit tests are complete and passing.
All 5 functional tests are complete and passing.
What am I doing wrong that does not allow me to pass the last two tests?
I was able to run the tests on the Replit console, by typing in npm run test.
It shows all 21 test pass. But then why am I not able to pass the freeCodeCamp test?
I also need help understanding what this means,
Copy the sample.env file to .env and set the variables appropriately
Do I have to create something for the Secret Environment Variables (padlock icon)?
I tried to create my own .env file, which I named my-own.env file. Then I just copied and paste the PORT=3000 into my .env file.
What does it mean when, “To run the tests uncomment NODE_ENV=test in your .env file” ?
What does this requirement from FCC want me to do and how do I do it on Replit?
I took your advice to add NODE_ENV=true to the SECRET tab.
I went back to my Replit. I typed in Secrets System environment variables.
I put in key is NODE_ENV and value is true.
Then I click the insert button and got const mySecret = process.env['NODE_ENV']
I put that const mySecret in the server.js file.
I put it below the const cors = require('cors');
const express = require('express');
const bodyParser = require('body-parser');
const expect = require('chai').expect;
const cors = require('cors');
//=== Use advice from FCC help, Add NODE_ENV=true to the SECRET tab
const mySecret = process.env['NODE_ENV']
//===========
I ran my test on FCC and it still does not allow me to pass. I still cannot pass the last two tests.
What about the sample.env file? I see it has PORT & # NODE_ENV
PORT=3000
# NODE_ENV=test
Am I suppose to leave it alone or do I have to do something with it?
I read through the FCC project test. It requires me to work in the following replit files:
/controllers/convertHandler.js
/routes/api.js
tests/1_unit-tests.js
tests/2_functional-tests.js
Did I also have to work on the server.js file? Am I suppose to also add a dependency in the package.json file?