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

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

@JamesTrickeyD

Description

@JamesTrickeyD

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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions