From 7fe32f85986991631bf84caec8e6b4b1e766f294 Mon Sep 17 00:00:00 2001 From: Alex Matthews Date: Thu, 2 Jan 2025 11:47:27 -0600 Subject: [PATCH] Refactors node compatibility test to improve base URL validation --- test/node_compatibility/index.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/test/node_compatibility/index.js b/test/node_compatibility/index.js index 60eb9c37..b3608024 100644 --- a/test/node_compatibility/index.js +++ b/test/node_compatibility/index.js @@ -1,14 +1,9 @@ -const dotenv = require('dotenv'); - -dotenv.config(); - const EasyPostClient = require('../..'); const test = async () => { - const apiKey = process.env.EASYPOST_TEST_API_KEY; - const client = new EasyPostClient(apiKey); + const client = new EasyPostClient('apiKey'); - if (!client.baseUrl.includes('easypost.com')) { + if (!client.baseUrl.match(/^(http|https):\/\/api.easypost.com/gm)) { process.exit(1); } };