jest-util
Advanced tools
Comparing version 9.0.3 to 10.0.0
@@ -16,15 +16,12 @@ /** | ||
// filter for noisy stack trace lines | ||
const STACK_TRACE_LINE_IGNORE_RE = new RegExp([ | ||
'^timers.js$', | ||
'^' + path.resolve(__dirname, '..', 'lib', 'moduleMocker.js'), | ||
'^' + path.resolve(__dirname, '..', '..', 'vendor', 'jasmine'), | ||
].join('|')); | ||
const STACK_TRACE_LINE_IGNORE_RE = | ||
/^\s+at.*?jest(-cli)?\/(vendor|src|node_modules|packages)\//; | ||
function cleanStackTrace(stackTrace) { | ||
let lines = 0; | ||
const keepFirstLines = () => (lines++ < KEEP_TRACE_LINES); | ||
return stackTrace.split('\n').filter(line => ( | ||
keepFirstLines() || | ||
!/^\s+at.*?jest(-cli)?\/(vendor|src|node_modules)\//.test(line) | ||
)).join('\n'); | ||
return stackTrace.split('\n') | ||
.filter(line => | ||
(lines++ < KEEP_TRACE_LINES) || !STACK_TRACE_LINE_IGNORE_RE.test(line) | ||
) | ||
.join('\n'); | ||
} | ||
@@ -64,7 +61,8 @@ | ||
} | ||
var filePath = matches[2]; | ||
// Filter out noisy and unhelpful lines from the stack trace. | ||
if (STACK_TRACE_LINE_IGNORE_RE.test(filePath)) { | ||
if (STACK_TRACE_LINE_IGNORE_RE.test(line)) { | ||
return null; | ||
} | ||
const filePath = matches[2]; | ||
return ( | ||
@@ -71,0 +69,0 @@ matches[1] + |
{ | ||
"name": "jest-util", | ||
"version": "9.0.3", | ||
"version": "10.0.0", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "dependencies": { |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
12107
6
359
1