I am developing a browser-based JavaScript library. For that purpose, I have set up a directory structure where each module is in a separate file and the final build is generated using webpack in a single file that is to be included in the web-page.
I want to set up a unit testing environment similar to Angular's Karma + Jasmine testing setup where I can write test cases for each module in a separate file and run a single command to execute these tests. Any testing setup is fine as long as a single command is enough to run all the tests and they can be kept in separate files.
I have looked into mocha's browser testing as I am somewhat familiar with mocha + expect testing for NodeJs but it seems like I have to include each file separately in the testing HTML file.
The main goal here is to keep the tests file near the files they are supposed to test as is the case in Angular so that they are easy to maintain and have a single command to run all the tests. The tests must run in a browser similar to how testing works in Angular.
from How to setup Karma and Jasmine unit-testing for common js library?
No comments:
Post a Comment