Skip to content
This repository has been archived by the owner on Oct 30, 2022. It is now read-only.

transform.responseBody doesn't seem to work in react native #415

Open
JamesTrickeyD opened this issue Aug 20, 2020 · 1 comment
Open

transform.responseBody doesn't seem to work in react native #415

JamesTrickeyD opened this issue Aug 20, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@JamesTrickeyD
Copy link

Description

transform.responseBody doesn't seem to work in react native

Steps to Reproduce

IN REACT NATIVE:

beforeAll(() => {
  const responseHeaders = {
    "content-type": "application/json",
  };
  unmock.on();
  unmock
    .nock(baseUrlForPayment, "AUTHENTICATION_ENDPOINT")
    .post(ENDPOINTS.AUTHENTICATION)
    .reply(
      200,
      {
        test: "hello",
      }
    )

  authenticationEndpoint = unmock.services["AUTHENTICATION_ENDPOINT"];
});

 describe("startAuthenticationSaga", () => {
    describe("when server returns 200", () => {
      it("should respond appropriately to an authentication failure", async () => {
        authenticationEndpoint.state(
          transform.responseBody("test").const("bye"),
        );
      
       // Run test and returned log body 

    });
})

Expected Result

// Run test and returned log body === "bye"

Actual Result

Additional Context

// Run test and returned log body === "hello"

@JamesTrickeyD JamesTrickeyD added the bug Something isn't working label Aug 20, 2020
@JamesTrickeyD
Copy link
Author

It this lib still active? (Sorry not being rude - genuine question)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant