You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for reporting an issue to us! We're glad you are using and invested in Enzyme.
Before submitting, please read over our commonly reported issues to prevent duplicates!
If you haven't found any duplicated issues, please report it with your environment!
Current behavior
When testing my project, I get this error with the mount() function:
TypeError: window.require is not a function
57 | };
58 |
> 59 | const wrapper = mount(<HealthStatusAnchor healthStatus={health} resourceId={resourceId} isImpactedEnabled={isIREnabled}/> );
| ^
60 |
61 | wrapper.find('button').simulate('click');
62 | expect(openBladeSpy).toHaveBeenCalledTimes(1);
at Object.getErrorBoundary (node_modules/azureportal-reactview/src/internal/ErrorBoundary.tsx:206:33)
at _FrameworkIcon (node_modules/azureportal-reactview/src/FrameworkIcon.tsx:51:27)
at renderWithHooks (node_modules/react-dom/cjs/react-dom.development.js:14803:18)
at mountIndeterminateComponent (node_modules/react-dom/cjs/react-dom.development.js:17482:13)
at beginWork (node_modules/react-dom/cjs/react-dom.development.js:18596:16)
at HTMLUnknownElement.callCallback (node_modules/react-dom/cjs/react-dom.development.js:188:14)
at HTMLUnknownElement.callTheUserObjectsOperation (node_modules/jsdom/lib/jsdom/living/generated/EventListener.js:26:30)
at innerInvokeEventListeners (node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:338:25)
at invokeEventListeners (node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:274:3)
at HTMLUnknownElementImpl._dispatch (node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:221:9)
at HTMLUnknownElementImpl.dispatchEvent (node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:94:17)
at HTMLUnknownElement.dispatchEvent (node_modules/jsdom/lib/jsdom/living/generated/EventTarget.js:231:34)
at Object.invokeGuardedCallbackDev (node_modules/react-dom/cjs/react-dom.development.js:237:16)
at invokeGuardedCallback (node_modules/react-dom/cjs/react-dom.development.js:292:31)
at beginWork$1 (node_modules/react-dom/cjs/react-dom.development.js:23203:7)
at performUnitOfWork (node_modules/react-dom/cjs/react-dom.development.js:22157:12)
at workLoopSync (node_modules/react-dom/cjs/react-dom.development.js:22130:22)
at performSyncWorkOnRoot (node_modules/react-dom/cjs/react-dom.development.js:21756:9)
at scheduleUpdateOnFiber (node_modules/react-dom/cjs/react-dom.development.js:21188:7)
at updateContainer (node_modules/react-dom/cjs/react-dom.development.js:24373:3)
at node_modules/react-dom/cjs/react-dom.development.js:24758:7
at unbatchedUpdates (node_modules/react-dom/cjs/react-dom.development.js:21903:12)
at legacyRenderSubtreeIntoContainer (node_modules/react-dom/cjs/react-dom.development.js:24757:5)
at Object.render (node_modules/react-dom/cjs/react-dom.development.js:24840:10)
at fn (node_modules/enzyme-adapter-react-16/src/ReactSixteenAdapter.js:488:26)
at node_modules/enzyme-adapter-react-16/src/ReactSixteenAdapter.js:405:37
at batchedUpdates$1 (node_modules/react-dom/cjs/react-dom.development.js:21856:12)
at Object.act (node_modules/react-dom/cjs/react-dom-test-utils.development.js:929:14)
at wrapAct (node_modules/enzyme-adapter-react-16/src/ReactSixteenAdapter.js:405:13)
at Object.render (node_modules/enzyme-adapter-react-16/src/ReactSixteenAdapter.js:474:16)
at new ReactWrapper (node_modules/enzyme/src/ReactWrapper.js:115:16)
at Object.mount (node_modules/enzyme/src/mount.js:10:10)
at Object.<anonymous> (components/common/__tests__/HealthStatusAnchor.spec.tsx:59:25)
Expected behavior
This test was running before, but after running yarn install, some of our other dependencies were updated and now the mount() function is throwing errors. We're not sure why this might be happening, since the relation between these updates and the new error is not clear. Does anyone know why this is happening?
Your environment
API
shallow
mount
render
Version
library
version
enzyme
3.11.0
react
16.14.0
react-dom
16.14.0
react-test-renderer
16.14.0
adapter (below)
Adapter
enzyme-adapter-react-16
enzyme-adapter-react-16.3
enzyme-adapter-react-16.2
enzyme-adapter-react-16.1
enzyme-adapter-react-15
enzyme-adapter-react-15.4
enzyme-adapter-react-14
enzyme-adapter-react-13
enzyme-adapter-react-helper
others ( )
The text was updated successfully, but these errors were encountered:
To use any node module in a browser, it should be bundled by a working node module bundler. In node, require is always present in CJS modules. I'm really unsure where this error could be coming from, and I think you'll need to provide more info.
We are using Jest, and the error is appearing in node when we run npm run test, for jest --config ./test-config/jest.config.js --verbose. As for a bundler, we are using webpack.
Thanks for reporting an issue to us! We're glad you are using and invested in Enzyme.
Before submitting, please read over our commonly reported issues to prevent duplicates!
All common issues
Notoriously common issues
If you haven't found any duplicated issues, please report it with your environment!
Current behavior
When testing my project, I get this error with the mount() function:
Expected behavior
This test was running before, but after running
yarn install
, some of our other dependencies were updated and now the mount() function is throwing errors. We're not sure why this might be happening, since the relation between these updates and the new error is not clear. Does anyone know why this is happening?Your environment
API
Version
Adapter
The text was updated successfully, but these errors were encountered: