@testing-library/dom
Advanced tools
Comparing version 10.2.0 to 10.3.0
@@ -19,16 +19,16 @@ "use strict"; | ||
const shouldHighlight = () => { | ||
let colors; | ||
// Try to safely parse env COLORS: We will default behavior if any step fails. | ||
try { | ||
colors = JSON.parse(process?.env?.COLORS); | ||
} catch (e) { | ||
// If this throws, process?.env?.COLORS wasn't parsable. Since we only | ||
// care about `true` or `false`, we can safely ignore the error. | ||
const colors = process?.env?.COLORS; | ||
if (colors) { | ||
const b = JSON.parse(colors); | ||
if (typeof b === 'boolean') return b; | ||
} | ||
} catch { | ||
// Ignore (non-critical) - Make a defaulting choice below. | ||
} | ||
if (typeof colors === 'boolean') { | ||
// If `colors` is set explicitly (both `true` and `false`), use that value. | ||
return colors; | ||
} else { | ||
// If `colors` is not set, colorize if we're in node. | ||
return typeof process !== 'undefined' && process.versions !== undefined && process.versions.node !== undefined; | ||
} | ||
// In all other cases, whether COLORS was a weird type, or the attempt threw: | ||
// Fall back to colorizing if we are running in node. | ||
return !!process?.versions?.node; | ||
}; | ||
@@ -35,0 +35,0 @@ const { |
{ | ||
"name": "@testing-library/dom", | ||
"version": "10.2.0", | ||
"version": "10.3.0", | ||
"description": "Simple and complete DOM testing utilities that encourage good testing practices.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
2425499
22447