Socket
Socket
Sign inDemoInstall

jest-matcher-utils

Package Overview
Dependencies
Maintainers
4
Versions
232
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-matcher-utils - npm Package Compare versions

Comparing version 18.1.0 to 18.5.0-alpha.7da3df39

31

build/index.js

@@ -15,3 +15,5 @@ /**

const prettyFormat = require('pretty-format');
const AsymmetricMatcherPlugin = require('pretty-format/build/plugins/AsymmetricMatcher');
const PLUGINS = [AsymmetricMatcherPlugin];

@@ -31,4 +33,7 @@

const EXPECTED_COLOR = chalk.green;
const EXPECTED_BG = chalk.bgGreen;
const RECEIVED_COLOR = chalk.red;
const RECEIVED_BG = chalk.bgRed;

@@ -83,3 +88,3 @@ const NUMBERS = [

throw new Error(`value of unknown type: ${ value }`);
throw new Error(`value of unknown type: ${value}`);
};

@@ -94,3 +99,4 @@

maxDepth,
min: true });
min: true,
plugins: PLUGINS });

@@ -101,3 +107,4 @@ } catch (e) {

maxDepth,
min: true });
min: true,
plugins: PLUGINS });

@@ -111,5 +118,14 @@ }

const printReceived = object => RECEIVED_COLOR(stringify(object));
const printExpected = value => EXPECTED_COLOR(stringify(value));
const highlightTrailingWhitespace = (text, bgColor) =>
text.replace(/\s+$/gm, bgColor('$&'));
const printReceived = object => highlightTrailingWhitespace(
RECEIVED_COLOR(stringify(object)),
RECEIVED_BG);
const printExpected = value => highlightTrailingWhitespace(
EXPECTED_COLOR(stringify(value)),
EXPECTED_BG);
const printWithType = (

@@ -188,3 +204,3 @@ name,

EXPECTED_COLOR(expected) + (
secondArgument ? `, ${ EXPECTED_COLOR(secondArgument) }` : '') +
secondArgument ? `, ${EXPECTED_COLOR(secondArgument)}` : '') +
chalk.dim(')'));

@@ -195,3 +211,5 @@

module.exports = {
EXPECTED_BG,
EXPECTED_COLOR,
RECEIVED_BG,
RECEIVED_COLOR,

@@ -203,2 +221,3 @@ ensureActualIsNumber,

getType,
highlightTrailingWhitespace,
matcherHint,

@@ -205,0 +224,0 @@ pluralize,

7

package.json
{
"name": "jest-matcher-utils",
"description": "A set of utility functions for jest-matchers and related packages",
"version": "18.1.0",
"version": "18.5.0-alpha.7da3df39",
"repository": {

@@ -11,9 +11,6 @@ "type": "git",

"main": "build/index.js",
"scripts": {
"test": "../../packages/jest-cli/bin/jest.js"
},
"dependencies": {
"chalk": "^1.1.3",
"pretty-format": "^18.1.0"
"pretty-format": "^18.5.0-alpha.7da3df39"
}
}
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