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

jest-snapshot

Package Overview
Dependencies
Maintainers
5
Versions
280
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-snapshot - npm Package Compare versions

Comparing version 17.0.3 to 18.0.0

22

build/index.js

@@ -65,4 +65,4 @@ /**

const toMatchSnapshot = function (received, expected) {
this.dontThrow();const
const toMatchSnapshot = function (received, testName) {
this.dontThrow && this.dontThrow();const

@@ -77,4 +77,2 @@ currentTestName = this.currentTestName,isNot = this.isNot,snapshotState = this.snapshotState;

ensureNoExpected(expected, '.toMatchSnapshot');
if (!snapshotState) {

@@ -84,3 +82,3 @@ throw new Error('Jest: snapshot state must be initialized.');

const result = snapshotState.match(currentTestName, received);const
const result = snapshotState.match(testName || currentTestName, received);const
pass = result.pass;

@@ -93,3 +91,2 @@

const expectedString = expected.trim();

@@ -107,5 +104,4 @@ const actualString = actual.trim();

const message =
() => matcherHint('.toMatchSnapshot', 'value', '') + '\n\n' +
`${ RECEIVED_COLOR('Received value') } does not match ` +
const report =
() => `${ RECEIVED_COLOR('Received value') } does not match ` +
`${ EXPECTED_COLOR('stored snapshot ' + count) }.\n\n` + (

@@ -117,3 +113,7 @@ diffMessage ||

return { message, pass: false };
const message =
() => matcherHint('.toMatchSnapshot', 'value', '') + '\n\n' +
report();
return { message, pass: false, report };
}

@@ -123,3 +123,3 @@ };

const toThrowErrorMatchingSnapshot = function (received, expected) {
this.dontThrow();const
this.dontThrow && this.dontThrow();const
isNot = this.isNot;

@@ -126,0 +126,0 @@

@@ -14,4 +14,4 @@ /**

const ReactElementPlugin = require('pretty-format/plugins/ReactElement');
const ReactTestComponentPlugin = require('pretty-format/plugins/ReactTestComponent');
const ReactElementPlugin = require('pretty-format/build/plugins/ReactElement');
const ReactTestComponentPlugin = require('pretty-format/build/plugins/ReactTestComponent');

@@ -18,0 +18,0 @@ let PLUGINS = [ReactElementPlugin, ReactTestComponentPlugin];

@@ -63,2 +63,3 @@ /**

return addExtraLineBreaks(prettyFormat(data, {
escapeRegex: true,
plugins: getPlugins(),

@@ -65,0 +66,0 @@ printFunctionName: false }));

{
"name": "jest-snapshot",
"version": "17.0.3",
"version": "18.0.0",
"repository": {

@@ -11,8 +11,8 @@ "type": "git",

"dependencies": {
"jest-diff": "^17.0.3",
"jest-diff": "^18.0.0",
"jest-file-exists": "^17.0.0",
"jest-matcher-utils": "^17.0.3",
"jest-util": "^17.0.2",
"jest-matcher-utils": "^18.0.0",
"jest-util": "^18.0.0",
"natural-compare": "^1.4.0",
"pretty-format": "~4.2.1"
"pretty-format": "^18.0.0"
},

@@ -19,0 +19,0 @@ "scripts": {

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