bug: Error in mockIonicReact: "Invalid variable access: react_1" #18
Comments
Same problem here, I was in 0.1.1, I downgraded to version 0.0.3 and it worked. |
I had this problem on version 0.0.3. Upgraded to 0.2.0 and still didn't work. Inside mockIonicReact.js, Jest can't use the mockController unless the variable to which it is assigned also begins with the word "mock" |
I had the same problem with the latest versions. Downgrading to |
Just noticed version |
Still broken on |
This seems to have been resolved in |
Still exists in |
@tekno0ryder Weird, I upgraded and everything is working fine for my project now. 😕 |
@zrev2220 I just wanted to test
|
Still happening on
Isn't something with the configuration wise ? |
Until this issue is fixed, feel free to use https://www.npmjs.com/package/@ananto/react-test-utils as a drop in replacement. |
resolves #18 Co-authored-by: anantoghosh <anantoghosh@users.noreply.github.com> BREAKING CHANGE: In Ionic v6, IonDatetime is no longer rendered as an overlay. As a result, the IonDatetime mock is no longer needed and has been removed. Developers can continue to use the real IonDatetime component imported from `@ionic/react`.
resolves #18 BREAKING CHANGE: In Ionic v6, IonDatetime is no longer rendered as an overlay. As a result, the IonDatetime mock is no longer needed and has been removed. Developers can continue to use the real IonDatetime component imported from `@ionic/react`. Co-authored-by: anantoghosh <anantoghosh@users.noreply.github.com>
Thanks for the report and apologies for the delay. This issue has been fixed in #44, and the fix will be available in the next release of Ionic React Test Utils. Please note that we removed the IonDatetime mock in this patch. In Ionic v5, IonDatetime was rendered as an overlay which required us to use a mock (similar to what we do for IonModal, IonAlert, etc). In Ionic v6, IonDatetime is rendered inline so the mock is not needed. However, developers can continue to test IonDatetime in their apps. |
This fix has been released as part of v0.4.0.
|
My
setupTests.ts
file looks like this:Nothing too fancy going on there, mainly just added
mockIonicReact()
. But when I upgraded to version^0.1.1
, all tests are now failing with this error message:This does not happen if I downgrade back to version
0.0.3
.The text was updated successfully, but these errors were encountered: