Now the jasimine framework which echarts is using for unit testing runs on the 
web page? Can we improve it to run test cases in node environment? I recommend 
using karma, the unit testing tool, and choosing the jasmine framework in the 
configuration.


The benefits of doing so are:
1. Jasmine framework supports running test cases in node environment, and the 
test results will be directly displayed in the terminal;
2. Karma is a JavaScript test execution process management tool based on 
node.js, which can be used to test all mainstream web browsers, and can also be 
integrated into CI tools.
3. Karma can make the test run in multiple browsers at the same time, such as 
chrome and Firefox. Some codes run in different browsers with different 
effects. The test results with karma are closer to the real environment.
4. Karma supports multiple plug-ins, such as code coverage, test reports, etc.
5. Currently, the framework used in UT is jasmine, so there is no need to 
modify the test cases.


Of course, there are also some problems. For example, some errors about 
'window' will be throwed when I try to modify it.


I hope you give some suggestions.

Reply via email to