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

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

python - Pygame screen.blit not working -

c# - Web API response xml language -