Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mochachai testing unit failing: "before all" hook in "Unit Tests" #39517

Closed
shartrooper opened this issue Sep 3, 2020 · 8 comments
Closed

Mochachai testing unit failing: "before all" hook in "Unit Tests" #39517

shartrooper opened this issue Sep 3, 2020 · 8 comments
Labels
scope: curriculum Lessons, Challenges, Projects and other Curricular Content in curriculum directory.

Comments

@shartrooper
Copy link

Describe your problem and how to reproduce it:
Hello.
After finishing the main scripts for both Sudoku Solver and American/British translator. I was unable to write test units that actually work for my code, and I mostly left the suite async configuration in the boilerplate testing files mostly intact.

So I went to their respective FCC challenge sample projects, checked their 1_unit-test.js code and run npm run test .
Then Just happens the same issue: Unit tests fail due to timeout and displays "before all" hook in "Unit Tests"

Add a Link to the page with the problem:

Sudoku Solver

American British translator

If possible, add a screenshot here (you can drag and drop, png, jpg, gif, etc. in this box):
issue1
issue2

@shartrooper shartrooper added scope: curriculum Lessons, Challenges, Projects and other Curricular Content in curriculum directory. status: waiting triage This issue needs help from moderators and users to reproduce and confirm its validity and fix. labels Sep 3, 2020
@moT01
Copy link
Member

moT01 commented Sep 14, 2020

Thanks for reporting this @shartrooper. I extended the timeout to 5000 and they pass on both projects...
Screen Shot 2020-09-14 at 10 55 24 AM
So I think if we extend that timeout on both the example projects and the boilerplates, we would probably be good. 5000 worked on both of them for me.

@shartrooper
Copy link
Author

Finally, Thanks a lot. Oddly enough, I've received zero feedback wherever I asked in regards of this issue. Now I have something to help sort out my testing unit coding issues too for my later projects.

@moT01
Copy link
Member

moT01 commented Sep 14, 2020

If you want, you can let us know if you come across this issue on other projects as well so we can fix them up 😄

@randomSveta
Copy link

randomSveta commented Sep 14, 2020

Hi! @moT01, the thing is that if you do "npm run test" everything works fine, but when tests run automaticaly, when project is in a working state, then tests have the same issue. Could you check it too, please? Am I doing something wrong? Thank you! (I have .env file with NODE_ENV=test). The "Sudoku Solver" project has the same issue. If you need, I can send links on both my projects.

tests-run-on-command

If project is in the "run" state.
test-run-before-all-hooks

@moT01
Copy link
Member

moT01 commented Sep 15, 2020

You can add the timeout option in test-runner.js and it will pass...

Screen Shot 2020-09-14 at 9 18 48 PM

@scissorsneedfoodtoo
Copy link
Contributor

Thanks for reporting this @shartrooper, and for catching the related issue with the automated test runner @randomSveta. @moT01's fixes were tested on these projects and merged into both boilerplates, so I'll close this for now.

Could you let us know if you have any other issues with the tests timing out?

@randomSveta
Copy link

@shartrooper, @moT01 , @scissorsneedfoodtoo, Thank you for your help! :)

@scissorsneedfoodtoo
Copy link
Contributor

@randomSveta, thanks again for your input! It was really helpful.

Please let us know if you run into any other issues with the projects.

@ilenia-magoni ilenia-magoni removed the status: waiting triage This issue needs help from moderators and users to reproduce and confirm its validity and fix. label Oct 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: curriculum Lessons, Challenges, Projects and other Curricular Content in curriculum directory.
Projects
None yet
Development

No branches or pull requests

5 participants