From 0452199f5ad769ff372d107e1d45e3c82729c43d Mon Sep 17 00:00:00 2001 From: Yongwoo Jung Date: Wed, 1 Dec 2021 10:04:59 +0900 Subject: [PATCH] release v1.1.2 --- package.json | 2 +- src/index.test.ts | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 75525d1..c33801b 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/src/index.test.ts b/src/index.test.ts index 3f9cd1c..7c9cf8a 100644 --- a/src/index.test.ts +++ b/src/index.test.ts @@ -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: "" + }])); + }); });