jest-snapshot
Advanced tools
| 'use strict';Object.defineProperty(exports, "__esModule", { value: true }); | ||
| const serialize = exports.serialize = ( | ||
| val, | ||
| config, | ||
| indentation, | ||
| depth, | ||
| refs, | ||
| printer) => | ||
| { | ||
| const mockObject = { | ||
| calls: val.mock.calls, | ||
| name: val.getMockName() }; | ||
| return printer(mockObject, config, indentation, depth, refs); | ||
| }; /** | ||
| * Copyright (c) 2014-present, Facebook, Inc. All rights reserved. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| * | ||
| */const test = exports.test = val => val && !!val._isMockFunction;exports.default = { serialize, test }; |
+8
-10
@@ -18,7 +18,2 @@ 'use strict'; | ||
| var _jestMatcherUtils = require('jest-matcher-utils'); | ||
| var _State = require('./State');var _State2 = _interopRequireDefault(_State); | ||
@@ -71,3 +66,5 @@ var _plugins = require('./plugins'); | ||
| const result = snapshotState.match( | ||
| testName || currentTestName || '', | ||
| testName && currentTestName ? | ||
| `${currentTestName}: ${testName}` : | ||
| currentTestName || '', | ||
| received);const | ||
@@ -120,3 +117,6 @@ | ||
| const toThrowErrorMatchingSnapshot = function (received, expected) { | ||
| const toThrowErrorMatchingSnapshot = function ( | ||
| received, | ||
| testName) | ||
| { | ||
| this.dontThrow && this.dontThrow();const | ||
@@ -131,4 +131,2 @@ isNot = this.isNot; | ||
| (0, _jestMatcherUtils.ensureNoExpected)(expected, '.toThrowErrorMatchingSnapshot'); | ||
| let error; | ||
@@ -151,3 +149,3 @@ | ||
| return toMatchSnapshot.call(this, error.message); | ||
| return toMatchSnapshot.call(this, error.message, testName); | ||
| }; | ||
@@ -154,0 +152,0 @@ |
+16
-9
@@ -12,13 +12,20 @@ 'use strict';Object.defineProperty(exports, "__esModule", { value: true });exports.getSerializers = exports.addSerializer = undefined; | ||
| var _prettyFormat = require('pretty-format');var _prettyFormat2 = _interopRequireDefault(_prettyFormat);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} /** | ||
| * Copyright (c) 2014-present, Facebook, Inc. All rights reserved. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| * | ||
| */var _prettyFormat$plugins = _prettyFormat2.default.plugins;const DOMElement = _prettyFormat$plugins.DOMElement,Immutable = _prettyFormat$plugins.Immutable,ReactElement = _prettyFormat$plugins.ReactElement,ReactTestComponent = _prettyFormat$plugins.ReactTestComponent; | ||
| var _prettyFormat = require('pretty-format');var _prettyFormat2 = _interopRequireDefault(_prettyFormat); | ||
| var _mock_serializer = require('./mock_serializer');var _mock_serializer2 = _interopRequireDefault(_mock_serializer);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}var _prettyFormat$plugins = | ||
| let PLUGINS = [ReactTestComponent, ReactElement, DOMElement, Immutable]; | ||
| _prettyFormat2.default.plugins; /** | ||
| * Copyright (c) 2014-present, Facebook, Inc. All rights reserved. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| * | ||
| */const DOMElement = _prettyFormat$plugins.DOMElement,Immutable = _prettyFormat$plugins.Immutable,ReactElement = _prettyFormat$plugins.ReactElement,ReactTestComponent = _prettyFormat$plugins.ReactTestComponent;let PLUGINS = [ReactTestComponent, ReactElement, DOMElement, Immutable, _mock_serializer2.default]; | ||
| // Prepend to list so the last added is the first tested. | ||
@@ -25,0 +32,0 @@ const addSerializer = exports.addSerializer = plugin => { |
+4
-4
| { | ||
| "name": "jest-snapshot", | ||
| "version": "21.3.0-beta.1", | ||
| "version": "21.3.0-beta.2", | ||
| "repository": { | ||
@@ -12,8 +12,8 @@ "type": "git", | ||
| "chalk": "^2.0.1", | ||
| "jest-diff": "21.3.0-beta.1", | ||
| "jest-matcher-utils": "21.3.0-beta.1", | ||
| "jest-diff": "21.3.0-beta.2", | ||
| "jest-matcher-utils": "21.3.0-beta.2", | ||
| "mkdirp": "^0.5.1", | ||
| "natural-compare": "^1.4.0", | ||
| "pretty-format": "21.3.0-beta.1" | ||
| "pretty-format": "21.3.0-beta.2" | ||
| } | ||
| } |
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
7
16.67%426
6.23%23193
-1.58%+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
Updated
Updated