简体   繁体   中英

React JSPM testing framework

What is the best testing framework and its associated helper libraries to use for a project in React and JSPM? I'm looking for various libraries combined together and what is specific to that set which makes it a powerful toolset? (Looking to incorporate redux later on)

I recently build testing environment for a react application using JSPM.

I first wanted to use Jest , as it is recommended by the community with react. But then I found out that thread , saying support for JSPM/SystemJs wasn't on the roadmap at the moment.

Although it exists some work to make it work, see for example: https://www.npmjs.com/package/systemjs-jest


Then I chose to use Jasmine as it is quite known in my company, and I already worked with it. Also I think Jest used to be based on Jasmine , so many react-specific matchers developed for Jest are also compatible with Jasmine .


So I ended up using Jasmine with Karma , using karma-jasmine and karma-uiuxengineering-jspm .

Make sure to read the documentation of karma-uiuxengineering-jspm thoroughly, it took me some time to set the environment up.

Some nice additions:
- jasmine-enzyme (installed with JSPM)
- karma-mocha-reporter (installed with npm)
- karma-phantomjs-launcher (installed with npm)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM