Socket
Socket
Sign inDemoInstall

jest-message-util

Package Overview
Dependencies
Maintainers
5
Versions
203
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-message-util - npm Package Compare versions

Comparing version 22.2.0 to 22.4.0

41

build/index.js

@@ -47,2 +47,5 @@ 'use strict';Object.defineProperty(exports, "__esModule", { value: true });exports.separateMessageFromStack = exports.formatResultsErrors = exports.formatStackTrace = exports.formatExecError = undefined;

const PATH_NODE_MODULES = `${_path2.default.sep}node_modules${_path2.default.sep}`;
const PATH_EXPECT_BUILD = `${_path2.default.sep}expect${_path2.default.sep}build${_path2.default.sep}`;
// filter for noisy stack trace lines

@@ -65,3 +68,3 @@ const JASMINE_IGNORE = /^\s+at(?:(?:.*?vendor\/|jasmine\-)|\s+jasmine\.buildExpectationResult)/;

const trim = string => (string || '').replace(/^\s+/, '').replace(/\s+$/, '');
const trim = string => (string || '').trim();

@@ -220,2 +223,18 @@ // Some errors contain not only line numbers in stack traces

const getTopFrame = lines => {
for (const line of lines) {
if (line.includes(PATH_NODE_MODULES) || line.includes(PATH_EXPECT_BUILD)) {
continue;
}
const parsedFrame = stackUtils.parseLine(line.trim());
if (parsedFrame && parsedFrame.file) {
return parsedFrame;
}
}
return null;
};
const formatStackTrace = exports.formatStackTrace = (

@@ -234,14 +253,4 @@ stack,

const topFrame = lines.
map(line => line.trim()).
filter(Boolean).
filter(
line =>
!line.includes(`${_path2.default.sep}node_modules${_path2.default.sep}`) &&
!line.includes(`${_path2.default.sep}expect${_path2.default.sep}build${_path2.default.sep}`)).
const topFrame = getTopFrame(lines);
map(line => stackUtils.parseLine(line)).
filter(Boolean).
filter(parsedFrame => parsedFrame.file)[0];
if (topFrame) {

@@ -264,5 +273,7 @@ const filename = topFrame.file;

const stacktrace = lines.
map(trimPaths).
map(formatPaths.bind(null, config, options, relativeTestPath)).
map(line => STACK_INDENT + line).
map(
line =>
STACK_INDENT +
formatPaths(config, options, relativeTestPath, trimPaths(line))).
join('\n');

@@ -269,0 +280,0 @@

{
"name": "jest-message-util",
"version": "22.2.0",
"version": "22.4.0",
"repository": {

@@ -5,0 +5,0 @@ "type": "git",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc