Socket
Socket
Sign inDemoInstall

enzyme-matchers

Package Overview
Dependencies
Maintainers
1
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

enzyme-matchers - npm Package Compare versions

Comparing version 6.1.2 to 7.0.0

lib/assertions/toHaveDisplayName.js

41

lib/assertions/toHaveTagName.js

@@ -7,42 +7,21 @@ 'use strict';

var _name = require('../utils/name');
var _deprecate = require('../utils/deprecate');
var _name2 = _interopRequireDefault(_name);
var _deprecate2 = _interopRequireDefault(_deprecate);
var _html = require('../utils/html');
var _toHaveDisplayName = require('./toHaveDisplayName');
var _html2 = _interopRequireDefault(_html);
var _toHaveDisplayName2 = _interopRequireDefault(_toHaveDisplayName);
var _single = require('../utils/single');
var _colors = require('../utils/colors');
var _single2 = _interopRequireDefault(_single);
var _colors2 = _interopRequireDefault(_colors);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* This source code is licensed under the MIT-style license found in the
* LICENSE file in the root directory of this source tree. *
*
* @providesModule toHaveTagNameAssertion
*
*/
var toHaveTagName = (0, _deprecate2.default)(function (enzymeWrapper, tag) {
return (0, _toHaveDisplayName2.default)(enzymeWrapper, tag);
}, 'Matcher ' + _colors2.default.red('toHaveTagName') + ' is deprecated and will be removed in a future release. ' + ('Use the replacement, ' + _colors2.default.blue('toHaveDisplayName') + ' instead.'));
function toHaveTagName(enzymeWrapper, tag) {
var wrapperHtml = (0, _html2.default)(enzymeWrapper);
var actualTag = enzymeWrapper.name();
var pass = actualTag === tag;
var wrapperName = '<' + (0, _name2.default)(enzymeWrapper) + '>';
return {
pass: pass,
message: 'Expected ' + wrapperName + ' node to equal (using ===) type "' + tag + '" but it is a "' + actualTag + '".',
negatedMessage: 'Expected ' + wrapperName + ' node not to equal (using ===) type "' + tag + '" but it is that type.',
contextualInformation: {
actual: wrapperHtml
}
};
}
exports.default = (0, _single2.default)(toHaveTagName);
exports.default = toHaveTagName;
module.exports = exports['default'];

@@ -7,2 +7,10 @@ 'use strict';

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /**
* This source code is licensed under the MIT-style license found in the
* LICENSE file in the root directory of this source tree. *
*
* @providesModule toMatchElementAssertion
*
*/
var _enzyme = require('enzyme');

@@ -30,4 +38,4 @@

var actual = actualEnzymeWrapper.debug(options);
var expected = expectedWrapper.debug(options);
var actual = actualEnzymeWrapper.debug(_extends({ verbose: true }, options));
var expected = expectedWrapper.debug(_extends({ verbose: true }, options));
var pass = actual === expected;

@@ -44,11 +52,5 @@

};
} /**
* This source code is licensed under the MIT-style license found in the
* LICENSE file in the root directory of this source tree. *
*
* @providesModule toMatchElementAssertion
*
*/
}
exports.default = (0, _single2.default)(toMatchElement);
module.exports = exports['default'];

@@ -43,2 +43,6 @@ 'use strict';

var _toHaveDisplayName = require('./assertions/toHaveDisplayName');
var _toHaveDisplayName2 = _interopRequireDefault(_toHaveDisplayName);
var _toHaveHTML = require('./assertions/toHaveHTML');

@@ -94,2 +98,10 @@

/**
* This source code is licensed under the MIT-style license found in the
* LICENSE file in the root directory of this source tree. *
*
* @providesModule enzyme-matchrs
*
*/
var assertions = {

@@ -105,2 +117,3 @@ toBeChecked: _toBeChecked2.default,

toHaveClassName: _toHaveClassName2.default,
toHaveDisplayName: _toHaveDisplayName2.default,
toHaveHTML: _toHaveHTML2.default,

@@ -120,10 +133,2 @@ toHaveProp: _toHaveProp2.default,

// Protect all assertions from being called with not-enzyme-wrappers.
/**
* This source code is licensed under the MIT-style license found in the
* LICENSE file in the root directory of this source tree. *
*
* @providesModule enzyme-matchrs
*
*/
Object.keys(assertions).forEach(function (key) {

@@ -130,0 +135,0 @@ assertions[key] = (0, _protectAssertion2.default)(assertions[key]);

{
"name": "enzyme-matchers",
"version": "6.1.2",
"version": "7.0.0",
"description": "Testing Matchers for Enzyme",

@@ -31,3 +31,3 @@ "main": "lib/index.js",

"peerDependencies": {
"enzyme": "3.x"
"enzyme": ">=3.4.0"
},

@@ -39,3 +39,3 @@ "dependencies": {

"devDependencies": {
"enzyme": "^3.0.0",
"enzyme": "^3.4.0",
"flow-bin": "^0.66.0"

@@ -54,3 +54,3 @@ },

},
"gitHead": "6d1c67cc68196c088f097b4b7829ee9eb9439cff"
"gitHead": "bf8db2a51ea71974d741089704fb4f2f49d8afa3"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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