Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable Babel integration in Jest?

I have project which has code targeting both browser and node. It has .babelrc file for the browser code. But when I'm running tests for the node code using Jest it always reads the .babelrc file which is not required.

So I can somehow disable it?

like image 212
Epeli Avatar asked Feb 12 '17 20:02

Epeli


1 Answers

You need to create an additional jest setting file for your node test. In this file set transform to an empty object. To use this file you need to call jest with the --config option pointing to your node jest setting.

like image 113
Andreas Köberle Avatar answered Nov 06 '22 12:11

Andreas Köberle