vite-plugin-istanbul
Advanced tools
Comparing version 2.1.0 to 2.1.1
@@ -29,3 +29,3 @@ "use strict"; | ||
function transformCode(srcCode, id, opts) { | ||
const plugins = [babel_plugin_istanbul_1.default, opts]; | ||
const plugins = [[babel_plugin_istanbul_1.default, opts]]; | ||
const cwd = process.cwd(); | ||
@@ -87,6 +87,7 @@ const { code, map } = core_1.transformSync(srcCode, { | ||
function istanbulPlugin(opts) { | ||
var _a; | ||
// Only instrument when we want to, as we only want instrumentation in test | ||
const env = opts.cypress ? process.env.CYPRESS_COVERAGE : process.env.VITE_COVERAGE; | ||
const defaultValue = opts.requireEnv ? '' : 'true'; | ||
if ((env || defaultValue).toLowerCase() == 'true') { | ||
const requireEnv = (_a = opts.requireEnv) !== null && _a !== void 0 ? _a : false; | ||
if (requireEnv && (env === null || env === void 0 ? void 0 : env.toLowerCase()) === 'false') { | ||
return { name: 'vite:istanbul' }; | ||
@@ -93,0 +94,0 @@ } |
{ | ||
"name": "vite-plugin-istanbul", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"author": "iFaxity (christian@faxity.se)", | ||
@@ -40,4 +40,6 @@ "license": "MIT", | ||
"test-exclude": "^6.0.0", | ||
"typescript": "^3.9.7" | ||
"typescript": "^3.9.7", | ||
"@semantic-release/changelog": "^5.0.1", | ||
"@semantic-release/git": "^9.0.0" | ||
} | ||
} |
@@ -41,4 +41,4 @@ vite-plugin-istanbul | ||
* `opts.extension {string|string[]}` - Optional string or array of strings of extensions to include (dot prefixed like .js or .ts) | ||
* `opts.requireEnv {string}` - Optional string to require env to be true to instrument to code, otherwise it will instrument even if env variable is not set | ||
* `opts.cypress {string}` - Optional string to change the env to CYPRESS_COVERAGE instead of VITE_COVERAGE. For more ease of use with @cypress/code-coverage | ||
* `opts.requireEnv {boolean}` - Optional boolean to require env to be true to instrument to code, otherwise it will instrument even if env variable is not set | ||
* `opts.cypress {boolean}` - Optional boolean to change the env to CYPRESS_COVERAGE instead of VITE_COVERAGE. For more ease of use with @cypress/code-coverage | ||
@@ -60,3 +60,3 @@ Examples | ||
include: 'src/*', | ||
exclude: [/node_modules/, 'test/'], | ||
exclude: ['node_modules', 'test/'], | ||
extension: [ '.js', '.ts' ], | ||
@@ -63,0 +63,0 @@ }), |
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
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
13340
8
112
8