● Test suite failed to run Invariant Violation: `new NativeEventEmitter()` requires a non-null argument.
Sahand-Stefan opened this issue · 4 comments
Sahand-Stefan commented
I am facing issue in this dependency while running tests with jest
Sahand-Stefan commented
● Test suite failed to run
Invariant Violation: `new NativeEventEmitter()` requires a non-null argument.
1 | import React from "react"
2 | import { Image, ImageStyle, ImageResizeMode, ImageBackground } from "react-native"
> 3 | import { CachedImage } from "@georstat/react-native-image-cache"
| ^
4 | import { EnumImageType } from "@app/constants"
5 |
6 | interface LActImageProps {
efstathiosntonas commented
Hi @Sahand-Stefan, it seems the issue comes from react-native-file-access
, it's using NativeEventEmitter
as seen here
Please open an issue on that repo and reference this issue here.
Sahand-Stefan commented
Yes Thanks, I mocked it like this and is working now:
jest.mock("@georstat/react-native-image-cache", () => ({ source: "", CacheManager: { config: {}, }, }))
efstathiosntonas commented
Great, glad you found a solution!