mocha-react
v1.1.2
Published
An easy way to use Mocha (a lot faster than Jest!) for testing React components written in plain Javascript or Typescript.
Downloads
1
Readme
Mocha React
An easy way to use Mocha (a lot faster than Jest!) for testing React components written in plain Javascript or Typescript.
Install it
yarn add mocha-react
Setup mocha on your project
Add this to your global.d.ts
file:
import 'mocha-react/types'
Change your test script on package.json
to:
"test": "mocha --config ./node_modules/mocha-react/config.js src/**/*.{test,spec}.{ts,tsx} --exit"
You can use any other Mocha params if you need to (e.g. --watch
), but passing this config param is all you need to have things running smoothly.