2 ms·
How would I run a React unit test from the command line? Or would I have to run it in-browser? Any pointers would be welcome
by pmarreck 10y ago
How would I run a React unit test from the command line? Or would I have to run it in-browser? Any pointers would be welcome
- onion2k 10y agoJest uses jsdom. You just need to add it to a project ("npm install --save-dev jest"), write a spec, and then run npm test (maybe update package.json to have 'jest' as the test command). It's really, really easy. There's even a repl so you can try it in a browser first - https://facebook.github.io/jest/#use https://facebook.github.io/jest/#use