Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jest Test Error #91

Open
Quadriphobs1 opened this issue Sep 12, 2018 · 2 comments
Open

Jest Test Error #91

Quadriphobs1 opened this issue Sep 12, 2018 · 2 comments

Comments

@Quadriphobs1
Copy link

Quadriphobs1 commented Sep 12, 2018

I installed the sentry package and integrated this package for redux which is working fine not until in started using the package on some component I have tested with jest and I keep getting a very weird error TypeError: Cannot use 'in' operator to search for 'fetch' in true which has to deal with raven.

Now if i remove it from the component the test seems to go, any idea

@AndriiNeverov
Copy link

@Quadriphobs1 Don't know if this is going to lead anywhere, but adding the following to jest.config.js at least resolves the compile error:

const window = {
    addEventListener: () => {
    },

    removeEventListener: () => {
    },
};

module.exports = {
    ...
    "globals": {
        "window": window,
        ...
    },
};

@captbaritone
Copy link
Owner

Odd. I'm guessing that adding raven-for-redux results in some Raven code which tries to use window.fetch getting called. Do you have JS-DOM enabled in Jest?

Do you have a full stack trace you could share?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants