Jest broken by applicationinsights-react-js
See original GitHub issueIn attempting to switch from react-appinsights to application-insights-react-js, many of my Jest tests starting failing with this error:
● Test suite failed to run
Cannot find module './cjs/react.development.js' from 'applicationinsights-react-js.js'
This is easily reproducible by cloning the demo app, then attempting to run tests. You may want to consider an Azure Pipelines build to the demo app to catch this kind of thing.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:13 (3 by maintainers)
Top Results From Across the Web
React app Jest unit test failing with Microsoft application ...
I'm trying to use the Microsoft's Application Insights JavaScript SDK React Plugin in my React application, and although it's working ...
Read more >React plug-in for Application Insights JavaScript SDK
The React plug-in for the Application Insights JavaScript SDK enables: Tracking of route changes. React components usage statistics.
Read more >@microsoft/applicationinsights-react-js - npm package | Snyk
The npm package @microsoft/applicationinsights-react-js was scanned for known vulnerabilities and missing license, and no issues were found. Thus the package ...
Read more >@microsoft/applicationinsights-web | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >microsoft/applicationinsights-react-js/README.md - UNPKG
9, - React components usage statistics. 10. 11, React Plugin for the Application Insights Javascript SDK. 12. 13, ## Getting Started.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
until gets fixed, you can mock it:
jest.mock('@microsoft/applicationinsights-react-js', () => ({ ReactPlugin: jest.fn() }));
@andrewconnell The fix for this just landed in the latest release. Can you update your web SDK and React plugin to latest version and verify that it is working now? latest React plugin = 2.0.2 latest Web SDK = 2.0.1