Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
abduliOS opened this issue Sep 16, 2022 · 1 comment
Open

Comments

@abduliOS
Copy link

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");
});

Screenshot 2022-09-16 at 8 51 52 AM

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

@saketh-kowtha
Copy link

saketh-kowtha commented Oct 3, 2022

Looks issue with configuration. Not with the implementation. May be you can share complete error message. I tested in code-sandbox it passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants