-
Notifications
You must be signed in to change notification settings - Fork 11
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
Cannot mock ApplicationInsights in Jest tests #66
Comments
Hmm I'll take a closer look at this when I'm out of work (will probably have to inspect the source code of ApplicationInsights), but it's possible it will be addressed by #44, which has yet to be released. Take a look at the |
Here's a link to the options for this plugin, with details about |
I confirmed that the plugin is transforming the ApplicationInsights dist correctly, so you can disregard my comments from above. I figured it was something to do with your config, so I did a bit of digging and came across this issue jestjs/jest#6053 (comment). I was able to get your tests passing by deleting the file in
Hope that helps; closing this issue because it isn't related to transforming AMD to commonjs. |
Awesome! Thank you so much for this and for the plugin! 👍 |
Hi,
I'm trying to use this plugin to write Jest mock tests for Application Insights, which does not support CommonJS. Unfortunately I can't manage to make it work: for some reason it throws a
ReferenceError: define is not defined
when importing Application Insights.The code of my very small project is at this branch: https://github.com/pviotti/react-appinsights/tree/testing-babel-converter
Here's the relevant configuration (mostly taken from the example project in this repo):
jest.config.js
webpack.config.js
.babelrc
The text was updated successfully, but these errors were encountered: