Skip to content

Commit 45e21be

Browse files
committedAug 13, 2022
refactor: use the ci flag force no proxy in ci/pre-publish tests.
1 parent 8bbaaf4 commit 45e21be

File tree

3 files changed

+9
-14
lines changed

3 files changed

+9
-14
lines changed
 

‎jest-ci.config.js

-11
This file was deleted.

‎package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@
66
"scripts": {
77
"build": "tsc",
88
"test": "jest",
9-
"ci-test": "jest --runInBand --ci --config=jest-ci.config.js",
9+
"ci-test": "jest --runInBand --ci",
1010
"unit-test": "jest unit-tests/",
1111
"integration-test": "jest integration-tests/",
1212
"browser-tests-build": "webpack --config webpack.config.js --watch",
1313
"start-browser": "webpack --config webpack.config.js --watch",
14-
"preversion": "npm run ci-test",
14+
"prepublish-test": "npm run ci-test",
15+
"preversion": "npm run prepublish-test",
1516
"version": "npm run build",
1617
"postversion": "git push",
1718
"prepublishOnly": "npm version patch",

‎test-setup.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
module.exports = async function (globalConfig, projectConfig) {
22
require("dotenv").config();
3-
if (process.env["DATAVERSEIFY_USEPROXY"] === "1") {
3+
// If running in CI mode, never use the proxy - otherwise, control using the DATAVERSEIFY_USEPROXY environment variable set in the .env file
4+
/*
5+
DATAVERSEIFY_USEPROXY=1
6+
DATAVERSEIFY_PROXY=https://127.0.0.1:8888
7+
*/
8+
if (!globalConfig.ci && process.env["DATAVERSEIFY_USEPROXY"] === "1") {
49
const httpProxy = process.env["DATAVERSEIFY_PROXY"];
510
console.debug("Adding proxy:" + httpProxy);
611
if (!httpProxy) {

0 commit comments

Comments
 (0)
Please sign in to comment.