Skip to content

Commit 7fe32f8

Browse files
committed
Refactors node compatibility test to improve base URL validation
1 parent 33fea3b commit 7fe32f8

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

test/node_compatibility/index.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
1-
const dotenv = require('dotenv');
2-
3-
dotenv.config();
4-
51
const EasyPostClient = require('../..');
62

73
const test = async () => {
8-
const apiKey = process.env.EASYPOST_TEST_API_KEY;
9-
const client = new EasyPostClient(apiKey);
4+
const client = new EasyPostClient('apiKey');
105

11-
if (!client.baseUrl.includes('easypost.com')) {
6+
if (!client.baseUrl.match(/^(http|https):\/\/api.easypost.com/gm)) {
127
process.exit(1);
138
}
149
};

0 commit comments

Comments
 (0)