samedi 22 avril 2017

Jest jQuery is undefined in module that uses it

I have a function that I'm trying to test:

// foo.js
import jquery from 'jquery'

export default function foo() {
  jquery.property....
}

-

// foo.test.js
import foo from './foo.js'

...test code...

When I run the test I get an error 'can't read property of undefined...'.

Aucun commentaire:

Enregistrer un commentaire