I'm using mocha with babel:register to test my react code.
mocha --compilers js:babel-register
In my react components (not the test), I'm using jquery with $ symbol and the test is complaining about $ is not a function. How can I ignore this?
The reason I'm doing this but not using import $ from 'jquery'
is because rails has jquery bundled so I don't want to duplicate it.
答案 0 :(得分:0)
import jquery from 'jquery';
global.$ = jquery;