jest-message-util
Advanced tools
Comparing version 19.0.0 to 19.1.0-alpha.eed82034
@@ -19,8 +19,9 @@ /** | ||
const separateMessageFromStack = require('./separateMessageFromStack'); | ||
const slash = require('slash'); | ||
// filter for noisy stack trace lines | ||
const JASMINE_IGNORE = | ||
/^\s+at(?:(?:.*?vendor\/|jasmine\-)|\s+jasmine\.buildExpectationResult)/; | ||
const STACK_TRACE_IGNORE = | ||
/^\s+at.*?jest(-.*?)?(\/|\\)(vendor|build|node_modules|packages)(\/|\\)/; | ||
/* eslint-disable max-len */ | ||
const JASMINE_IGNORE = /^\s+at(?:(?:.*?vendor\/|jasmine\-)|\s+jasmine\.buildExpectationResult)/; | ||
const STACK_TRACE_IGNORE = /^\s+at.*?jest(-.*?)?(\/|\\)(build|node_modules|packages)(\/|\\)/; | ||
/* eslint-enable max-len */ | ||
const TITLE_INDENT = ' '; | ||
@@ -84,6 +85,9 @@ const MESSAGE_INDENT = ' '; | ||
return ( | ||
TITLE_INDENT + TITLE_BULLET + EXEC_ERROR_MESSAGE + '\n\n' + | ||
message + stack + '\n'); | ||
return TITLE_INDENT + | ||
TITLE_BULLET + | ||
EXEC_ERROR_MESSAGE + | ||
'\n\n' + | ||
message + | ||
stack + | ||
'\n'; | ||
}; | ||
@@ -111,7 +115,3 @@ | ||
const formatPaths = ( | ||
config, | ||
relativeTestPath, | ||
line) => | ||
{ | ||
const formatPaths = (config, relativeTestPath, line) => { | ||
// Extract the file path from the trace line. | ||
@@ -123,10 +123,8 @@ const match = line.match(/(^\s*at .*?\(?)([^()]+)(:[0-9]+:[0-9]+\)?.*$)/); | ||
let filePath = path.relative(config.rootDir, match[2]); | ||
let filePath = slash(path.relative(config.rootDir, match[2])); | ||
// highlight paths from the current test file | ||
if ( | ||
config.testMatch && | ||
config.testMatch.length && | ||
micromatch(filePath, config.testMatch) || | ||
filePath === relativeTestPath) | ||
@@ -152,6 +150,7 @@ { | ||
const relativeTestPath = testPath ? | ||
path.relative(config.rootDir, testPath) : | ||
slash(path.relative(config.rootDir, testPath)) : | ||
null; | ||
lines = removeInternalStackEntries(lines, config); | ||
return lines.map(trimPaths). | ||
return lines. | ||
map(trimPaths). | ||
map(formatPaths.bind(null, config, relativeTestPath)). | ||
@@ -179,3 +178,4 @@ map(line => STACK_INDENT + line). | ||
return failedResults.map((_ref) => {let result = _ref.result,content = _ref.content;var _separateMessageFromS = | ||
return failedResults. | ||
map((_ref) => {let result = _ref.result,content = _ref.content;var _separateMessageFromS = | ||
separateMessageFromStack(content);let message = _separateMessageFromS.message,stack = _separateMessageFromS.stack; | ||
@@ -192,3 +192,4 @@ stack = config.noStackTrace ? | ||
const title = chalk.bold.red( | ||
TITLE_INDENT + TITLE_BULLET + | ||
TITLE_INDENT + | ||
TITLE_BULLET + | ||
result.ancestorTitles.join(ANCESTRY_SEPARATOR) + ( | ||
@@ -200,3 +201,4 @@ result.ancestorTitles.length ? ANCESTRY_SEPARATOR : '') + | ||
return title + '\n' + message + '\n' + stack; | ||
}).join('\n'); | ||
}). | ||
join('\n'); | ||
}; | ||
@@ -203,0 +205,0 @@ |
{ | ||
"name": "jest-message-util", | ||
"version": "19.0.0", | ||
"version": "19.1.0-alpha.eed82034", | ||
"repository": { | ||
@@ -11,5 +11,6 @@ "type": "git", | ||
"dependencies": { | ||
"chalk": "^1.1.1", | ||
"micromatch": "^2.3.11" | ||
"chalk": "^1.1.3", | ||
"micromatch": "^2.3.11", | ||
"slash": "^1.0.0" | ||
} | ||
} |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
15884
6
207
3
2
+ Addedslash@^1.0.0
+ Addedslash@1.0.0(transitive)
Updatedchalk@^1.1.3