reactjs - How do I use jest to test jsx components? -


according docs, jest can used test js files. can use test jsx? jsx files? can use test jsx files? if so, how?

you can use babel-jest testing jsx file. read more at here

to run test jsx file need add more .jsx when unmock or import implement code.

example:

for js file: jest.unmock('../jsx/checkboxwithlabel')

for jsx file: jest.unmock('../jsx/checkboxwithlabel.jsx')


Comments

Popular posts from this blog

php - Admin SDK -- get information about the group -

dns - How To Use Custom Nameserver On Free Cloudflare? -

Python Error - TypeError: input expected at most 1 arguments, got 3 -