Skip to content

Jest doesn't work with global jquery #708

@volodyad

Description

@volodyad

I have setup jest with webpack according to articles from https://facebook.github.io/jest/docs/getting-started.html. All works fine except I have got third party libraries which requires reference to global jquery. I have configured webpack in the next way
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery"
})
so it works when I run my app, but when I try to run test it says jQuery is not defined. What can I do with this issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions