Skip to content
This repository has been archived by the owner on Nov 11, 2023. It is now read-only.

Commit

Permalink
Add a test to validate the usage of url.resolve usage
Browse files Browse the repository at this point in the history
  • Loading branch information
fabien0102 committed Oct 1, 2018
1 parent 90f131a commit 9064270
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/Get.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,23 @@ describe("Get", () => {
await wait(() => expect(children.mock.calls.length).toBe(2));
});

it("should deal with trailing slashs", async () => {
nock("https://my-awesome-api.fake")
.get("/")
.reply(200);

const children = jest.fn();
children.mockReturnValue(<div />);

render(
<RestfulProvider base="https://my-awesome-api.fake/">
<Get path="/">{children}</Get>
</RestfulProvider>,
);

await wait(() => expect(children.mock.calls.length).toBe(2));
});

it("should compose the url with the base", async () => {
nock("https://my-awesome-api.fake")
.get("/plop")
Expand Down

0 comments on commit 9064270

Please sign in to comment.