Skip to content

Commit

Permalink
release v1.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
stegano committed Dec 1, 2021
1 parent c8ec437 commit 0452199
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "next-http-proxy-middleware",
"version": "1.1.1",
"version": "1.1.2",
"description": "Nextjs HTTP Proxy Middleware",
"main": "build/index.js",
"scripts": {
Expand Down
15 changes: 15 additions & 0 deletions src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,19 @@ describe("Test `rewritePath` functionn ", () => {
replaceStr: "/auth"
}]));
});

test("Issue(#45) test", () => {
const originUrl = "/test/api/graphql";
expect("/test").toEqual(rewritePath(originUrl, {
"/api/graphql": "",
}));
});

test("Issue(#45) test", () => {
const originUrl = "https://naver.com/test/api/graphql";
expect("https://naver.com/test/api/graphql").toEqual(rewritePath(originUrl, [{
patternStr: "/api/graphql",
replaceStr: ""
}]));
});
});

0 comments on commit 0452199

Please sign in to comment.