From 97b00d62ef2baa2288597301afcae46a306efc31 Mon Sep 17 00:00:00 2001 From: Mohd Ashraf <57627350+mohdashraf010897@users.noreply.github.com> Date: Wed, 31 Aug 2022 18:41:47 +0530 Subject: [PATCH 1/2] v5.1.0-alpha.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f4bf404..36b1ae8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "appbase-js", - "version": "5.1.0-alpha.2", + "version": "5.1.0-alpha.3", "main": "dist/appbase-js.cjs.js", "jsnext:main": "dist/appbase-js.es.js", "module": "dist/appbase-js.es.js", From 092f630a5e9e4e427dcce169067c15f3b6dca4b4 Mon Sep 17 00:00:00 2001 From: Mohd Ashraf <57627350+mohdashraf010897@users.noreply.github.com> Date: Mon, 5 Sep 2022 23:44:18 +0530 Subject: [PATCH 2/2] fix: failing test cases --- __tests__/AppBaseClientTest.js | 8 ++++++-- src/core/index.js | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/__tests__/AppBaseClientTest.js b/__tests__/AppBaseClientTest.js index c3b8208..08ffb14 100644 --- a/__tests__/AppBaseClientTest.js +++ b/__tests__/AppBaseClientTest.js @@ -24,7 +24,9 @@ describe("#AppBase_Client", () => { }); expect(true).toBe(false); } catch (e) { - expect(e.message).toEqual("URL not present in options."); + expect(e.message).toEqual( + "url is required when using the elasticsearch Search backend." + ); } }); test("should throw app missing error", () => { @@ -35,7 +37,9 @@ describe("#AppBase_Client", () => { }); expect(true).toBe(false); } catch (e) { - expect(e.message).toEqual("App name is not present in options."); + expect(e.message).toEqual( + "app is required when using the elasticsearch Search backend." + ); } }); test("should throw protocol missing error", () => { diff --git a/src/core/index.js b/src/core/index.js index ed6df66..3c0fae6 100644 --- a/src/core/index.js +++ b/src/core/index.js @@ -25,7 +25,7 @@ function AppBase(config) { host = '', path = '', protocol = '', - } = URL((config.endpoint ? config.endpoint.url : '') || config.url); + } = URL((config.endpoint ? config.endpoint.url : config.url) || ''); let { url } = config; url = host + path; // Parse url