Currently, I am experimenting with jest unit testing for a typescript-based react native project. However, I am facing an issue when I run npm test, and the error message is as follows:
● Test suite failed to run
TypeError: seamless_immutable_1.default is not a function
34 |
35 |
> 36 | export const INITIAL_STATE: ImmutableAppReducerState = Immutable({
| ^
37 | activeTab: 0,
38 | showTab: false,
39 | tabName: "",
The code snippet causing the error is:
import Immutable from "seamless-immutable";
export interface AppReducerState {
activeTab?: number | undefined;
showTab?: boolean | undefined;
tabName?: string | undefined;
isDrawerOpen: boolean;
retryAction: AnyAction[];
}
/* ------------- Initial State ------------- */
type ImmutableAppReducerState = Immutable.Immutable<AppReducerState>
export const INITIAL_STATE: ImmutableAppReducerState = Immutable({
activeTab: 0,
showTab: false,
tabName: "",
isDrawerOpen: false,
retryAction: [],
});