question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Jest broken by applicationinsights-react-js

See original GitHub issue

In 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:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
valentinvoileancommented, Jun 5, 2019

until gets fixed, you can mock it:

jest.mock('@microsoft/applicationinsights-react-js', () => ({ ReactPlugin: jest.fn() }));

1reaction
markwolffcommented, Jun 6, 2019

@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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found