How to write jest unit test cases for Ramda functions in React native

Viewed 35

I want to write unit test cases for Ramda functions used in React native App.

Currently i have react native 068.1 version and "ramda": "^0.27.1", "ramda-adjunct": "^2.32.0", "jest": "^24.0.0", and Typescript

Example of code I used

import * as R from "ramda";

const getEta = (format: string) => R.compose(curryMomentFormat(format), R.prop("requestDate"));

export const curryMomentFormat = R.curry((format, date) => moment(date).format(format));

So I write the following code to test, but I got some error

test("expected date should be in given format for given date", () => {
  expect(curryMomentFormat("lll", "11/12/2020")).toEqual("Nov 12, 2020 12:00 AM");
});

Test failed with this error

if possible any one can proivide document for jest unit test cases for ramda functions

0 Answers
Related