Hello. I’m taking on the challenge Metric-Imperial Converter, and I’m almost done.
The Chai tests all pass, the console gives me the following message:
Running Tests ...
Unit Tests
✓ Read a whole number
✓ Read a decimal number
✓ Read a fractional number
✓ Read a fractional number with decimal
✓ Error with double fraction unput
✓ Default to 1 if no number in input
✓ Read a correct unit input
✓ Refuses a non-corret unit input
✓ Return the correct return-unit
✓ Return the correctly spelled out unit
✓ Correctly converts from one unit to the others
Functional Tests
✓ get {input: "10l"} (74ms)
✓ get {input: "32g"}
✓ get {input: "3/7.2/4kg"}
✓ get {input: "3/7.2/4kilomegagram"}
✓ get {input: "kg"}
16 passing (127ms)
But the system test does not pass. The error that is returned to me is:
(*) All 16 unit tests are complete and passing.
(v) All 5 functional tests are complete and passing.
It therefore seems that the functional tests all pass, while there would be an error in the unit tests.
It seems to me that I built the tests exactly as required by the specifics of the problem.
What can be the mistake?
I enclose the invitation to replit, in case anyone wants to take a look at the code.
Hey @akiko-pusu (or anyone really ) can you give me some guidance? I’m having a similar issue to @SergioSpina. All of my tests pass locally, but both unit tests and functional tests don’t pass when I submit them to FCC. I have my live version of my app here, and my GitHub repo here.
I noticed I sometime get this error when submitting on the FCC website, but I haven’t found it to be particularly meaningful!
FCC’s chai-http sends the request to the endpoint “/_api/get-tests”.
Please see the server.js / line: 44.
So environment variable needs to defined as “NODE_ENV=test” .
Use .env file.
copy sample.env as .env in the same directory.
Comment out this line # NODE_ENV=test to NODE_ENV=test
Press start button
Or set the environment variable from the terminal and run npm start
Exp.
# on your terminal or replit's terminal
export NODE_ENV=test
npm run start
In case NODE_ENV=test is specified, before starting the Web service, unit tests and function tests are executed.
If no problem, web service starts to listen the request.