I've been working with Javascript and unit testing with Mocha. Two challenges.
- unit testing browser based javascript
- unit tests not picking up on imported javascript file
Finally got it working.
If you get stuck, check out this question
https://stackoverflow.com/questions/42857778/how-do-you-run-mocha-tests-in-the-browser
- unit testing browser based javascript
- unit tests not picking up on imported javascript file
Finally got it working.
If you get stuck, check out this question
https://stackoverflow.com/questions/42857778/how-do-you-run-mocha-tests-in-the-browser
Comments
My first javascript file was importing a second file, but the unit tests didn't pick up due to path issue. Fixed it by importing second file into unit tests.