Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

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.1.0 to 22.2.0

39

build/index.js

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

const getRenderedCallsite = (fileContent, line) => {
let renderedCallsite = (0, _codeFrame.codeFrameColumns)(
fileContent,
{ start: { line } },
{ highlightCode: true });
renderedCallsite = renderedCallsite.
split('\n').
map(line => MESSAGE_INDENT + line).
join('\n');
renderedCallsite = `\n${renderedCallsite}\n`;
return renderedCallsite;
};
// ExecError is an error thrown outside of the test suite (not inside an `it` or

@@ -232,16 +248,11 @@ // `before/after each` hooks). If it's thrown, none of the tests in the file

if (_path2.default.isAbsolute(filename)) {
renderedCallsite = (0, _codeFrame.codeFrameColumns)(
_fs2.default.readFileSync(filename, 'utf8'),
{
start: { line: topFrame.line } },
{ highlightCode: true });
renderedCallsite = renderedCallsite.
split('\n').
map(line => MESSAGE_INDENT + line).
join('\n');
renderedCallsite = `\n${renderedCallsite}\n`;
let fileContent;
try {
// TODO: check & read HasteFS instead of reading the filesystem:
// see: https://github.com/facebook/jest/pull/5405#discussion_r164281696
fileContent = _fs2.default.readFileSync(filename, 'utf8');
renderedCallsite = getRenderedCallsite(fileContent, topFrame.line);
} catch (e) {
// the file does not exist or is inaccessible, we ignore
}
}

@@ -248,0 +259,0 @@ }

{
"name": "jest-message-util",
"version": "22.1.0",
"version": "22.2.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