diff --git a/.mocharc.json b/.mocharc.json new file mode 100644 index 00000000..bd81f375 --- /dev/null +++ b/.mocharc.json @@ -0,0 +1,5 @@ +{ + "timeout": 10000, + "require": ["@babel/register", "dotenv/config", "./test/helpers/common.js"], + "recursive": true +} diff --git a/package-lock.json b/package-lock.json index a1d1140d..cbab821e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -44,6 +44,7 @@ "chai": "4.3.10", "chai-as-promised": "^7.1.1", "cross-env": "^7.0.3", + "dotenv": "^16.4.5", "eslint": "^8.40.0", "eslint-config-prettier": "^8.8.0", "eslint-import-resolver-webpack": "^0.13.2", @@ -4166,6 +4167,18 @@ "node": ">=6.0.0" } }, + "node_modules/dotenv": { + "version": "16.4.5", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", + "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, "node_modules/duplexer": { "version": "0.1.2", "dev": true, diff --git a/package.json b/package.json index 2fd9a270..42edd9ce 100644 --- a/package.json +++ b/package.json @@ -27,9 +27,9 @@ "lint": "eslint --ext .js,.ts .", "lintFix": "eslint --ext .js,.ts --fix .", "prepublishOnly": "npm run clean && npm run build && npm run test && npm run lint && npm run formatCheck", - "repl": "./repl.js --local easypost.js", + "repl": "./repl.js --local ./dist/easypost.js", "scan": "npx audit-ci -m --config ./audit-ci.jsonc", - "test": "cross-env NODE_ENV=test mocha --timeout 10000 --require @babel/register --require ./test/helpers/common.js --recursive ./test", + "test": "cross-env NODE_ENV=test mocha", "watch": "webpack --config webpack.config.babel.js --watch" }, "dependencies": { @@ -65,6 +65,7 @@ "chai": "4.3.10", "chai-as-promised": "^7.1.1", "cross-env": "^7.0.3", + "dotenv": "^16.4.5", "eslint": "^8.40.0", "eslint-config-prettier": "^8.8.0", "eslint-import-resolver-webpack": "^0.13.2",