sealights-jest-plugin
Advanced tools
Comparing version 2.0.1 to 2.0.2
{ | ||
"name": "sealights-jest-plugin", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "Sealights Jest integration plugin", | ||
@@ -8,10 +8,11 @@ "main": "tsOutputs/lib/index.js", | ||
"build": "tsc -p .", | ||
"test": "npm run test:all", | ||
"test:all": "export TEST_RUN=major && npm run test:v27 && npm run test:v26 && npm run test:v25 && npm run test:v24", | ||
"test:v27": "export JEST_VERSION=27 && mocha ./tsOutputs/test", | ||
"test:v26": "export JEST_VERSION=26 && mocha ./tsOutputs/test", | ||
"test:v25": "export JEST_VERSION=25 && mocha ./tsOutputs/test", | ||
"test:v24": "export JEST_VERSION=24 && mocha ./tsOutputs/test", | ||
"test:v23": "export JEST_VERSION=23 && mocha ./tsOutputs/test", | ||
"test:v22": "export JEST_VERSION=22 && mocha ./tsOutputs/test" | ||
"test": "node test/run-all-tests.js", | ||
"tests_for_version": "mocha --no-timeouts ./tsOutputs/testl", | ||
"test:all": "export TEST_RUN=major && npm run test:v29 && npm run test:v28 && npm run test:v27 && npm run test:v26 && npm run test:v25 && npm run test:v24", | ||
"test:v27": "export JEST_VERSION=27 && mocha --no-timeouts ./tsOutputs/test", | ||
"test:v26": "export JEST_VERSION=26 && mocha --no-timeouts ./tsOutputs/test", | ||
"test:v25": "export JEST_VERSION=25 && mocha --no-timeouts ./tsOutputs/test", | ||
"test:v24": "export JEST_VERSION=24 && mocha --no-timeouts ./tsOutputs/test", | ||
"test:v23": "export JEST_VERSION=23 && mocha --no-timeouts ./tsOutputs/test", | ||
"test:v22": "export JEST_VERSION=22 && mocha --no-timeouts ./tsOutputs/test" | ||
}, | ||
@@ -52,6 +53,6 @@ "keywords": [], | ||
"dependencies": { | ||
"sealights-plugins-common": "^2.0.1", | ||
"sealights-plugins-common": "^2.0.2", | ||
"slnodejs": "^6.1.137" | ||
}, | ||
"gitHead": "87375ba02935f334a47dfee6a44f4f2394d227db" | ||
"gitHead": "42f3812a0067407696d1dbda4db4067e3303d3f8" | ||
} |
@@ -111,2 +111,3 @@ "use strict"; | ||
errors: [], | ||
retryReasons: [], | ||
fn: () => { | ||
@@ -146,4 +147,4 @@ }, | ||
if (clientConfig.testEnvironment) { | ||
if (clientConfig.testEnvironment === 'jsdom') { | ||
slConfig.testEnvType = 'jsdom'; | ||
if (['jsdom', 'node'].includes(clientConfig.testEnvironment)) { | ||
slConfig.testEnvType = clientConfig.testEnvironment; | ||
} | ||
@@ -208,12 +209,20 @@ else { | ||
} | ||
return version; | ||
return parseInt(version); | ||
}; | ||
const getJestTestEnv = (testEnvType, testEnvPath) => { | ||
let envPath; | ||
if (['jsdom', 'node'].includes(testEnvType)) { | ||
envPath = path_1.default.join(process.cwd(), 'node_modules', `jest-environment-${testEnvType}`); | ||
} | ||
if (testEnvPath) { | ||
return require(testEnvPath); | ||
envPath = testEnvPath; | ||
} | ||
else { | ||
const userEnvPath = path_1.default.join(process.cwd(), 'node_modules', testEnvType === 'jsdom' ? 'jest-environment-jsdom' : 'jest-environment-node'); | ||
return require(userEnvPath); | ||
envPath = path_1.default.join(process.cwd(), 'node_modules', 'jest-environment-node'); | ||
} | ||
const envModule = require(envPath); | ||
if (envModule.default) { | ||
return envModule.default; | ||
} | ||
return envModule; | ||
}; | ||
@@ -220,0 +229,0 @@ exports.getJestTestEnv = getJestTestEnv; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
36127
485
10