Hello, I’m getting the below response when I automatically run the test even though all 21 tests are passing in the console output.
Here is the link to my code solution: boilerplate-project-metricimpconverter - Replit
Hello, I’m getting the below response when I automatically run the test even though all 21 tests are passing in the console output.
Try using Gitpod instead.
For some reason the test array returned from the internal endpoint /_api/get-tests
is empty.
Your code passes for me on Gitpod.
As an aside, the example project doesn’t pass either (sends {"status":"unavailable"}
for the /_api/get-tests
) but I can’t remember if that is supposed to be like that or what.
Thanks for the feedback. I encountered the same issue with Gitpod. When I adjusted the ‘test’ script in the ‘package.json’ to “mocha ./tests/1_unit-tests.js --ui tdd && mocha ./tests/2_functional-tests.js --ui tdd” I got, Passed: All 16 unit tests are complete and passing. but Failed: All 5 functional tests are complete and passing.
Instead of changing the script try adding NODE_ENV=test
to an .env
file.
If you have a GitHub repo with your code post that otherwise you can share your Gitpod workspace.
I did add NODE_ENV=test to an .env file, else I wouldn’t be able to run the tests automatically.
Here is my GitHub repo : GitHub - SBedeB/Metric-Imperial-Converter: Metric-Imperial Converter App
Thank you
Your code is passing for me on Gitpod. All I did was open the Gitpod boilerplate, copy and paste all the code, rename the .env
file from sample.env
to .env
and uncomment the test variable (and restart the server).
In the future, please clone the boilerplate down and keep everything as is (folder and file structure) make your changes, commit, and push that to your own repo.
I appreciate your feedback. When I comment /uncomment the test variable I get the below:
// running tests
All 16 unit tests are complete and passing.
All 5 functional tests are complete and passing.
// tests completed
// console output
[Error: expected { status: ‘unavailable’ } to be an array]
[Error: expected { status: ‘unavailable’ } to be an array]
I have no idea what to do to pass:
Failed: All 16 unit tests are complete and passing.
Failed: All 5 functional tests are complete and passing.
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.