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

unexpected-htmllike

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unexpected-htmllike - npm Package Compare versions

Comparing version 0.3.1 to 0.3.2

4

CHANGELOG.md

@@ -18,1 +18,5 @@

* Minor improvements to display of elements with children with attributes that need more than one line
### v0.3.2
* Fix bug with children being non-exact whilst ignoring the bits that aren't exact. e.g. you ignore extra attributes,
and have an extra attribute on a child, a `contains` check would not find the element.

2

lib/diff.js

@@ -442,3 +442,3 @@ 'use strict';

diffElementOrWrapper(actualAdapter, expectedAdapter, a, b, expect, options).then(function (elementDiff) {
return callback(elementDiff.weight.total === WEIGHT_OK);
return callback(elementDiff.weight.real === WEIGHT_OK);
});

@@ -445,0 +445,0 @@ }, function (a, b, aIndex, bIndex, callback) {

@@ -206,3 +206,32 @@ 'use strict';

});
it('finds a nested component with missing children and extra attribute', function () {
return expect({
name: 'div', attribs: {}, children: [{
name: 'span',
attribs: {},
children: ['one']
}, {
name: 'span',
attribs: { className: 'dummy' },
children: ['two']
}, {
name: 'span',
attribs: {},
children: ['three']
}]
}, 'when checked with options to contain', { diffExtraChildren: false, diffExtraAttributes: false }, {
name: 'div', attribs: {}, children: [{
name: 'span',
attribs: {},
children: ['two']
}]
}, 'to satisfy', {
found: true,
bestMatch: {
weight: 0
}
});
});
});
//# sourceMappingURL=contains.spec.js.map
{
"name": "unexpected-htmllike",
"version": "0.3.1",
"version": "0.3.2",
"description": "Helper library for unexpected plugins that perform assertions on XML like structures",

@@ -5,0 +5,0 @@ "author": {

@@ -445,3 +445,3 @@ import ArrayChangesAsync from 'array-changes-async';

diffElementOrWrapper(actualAdapter, expectedAdapter, a, b, expect, options).then(elementDiff => {
return callback(elementDiff.weight.total === WEIGHT_OK);
return callback(elementDiff.weight.real === WEIGHT_OK);
});

@@ -448,0 +448,0 @@ },

@@ -248,2 +248,37 @@ import Unexpected from 'unexpected';

});
it('finds a nested component with missing children and extra attribute', () => {
return expect({
name: 'div', attribs: {}, children: [
{
name: 'span',
attribs: {},
children: [ 'one' ]
},
{
name: 'span',
attribs: { className: 'dummy' },
children: [ 'two' ]
},
{
name: 'span',
attribs: {},
children: [ 'three' ]
}
]
}, 'when checked with options to contain', { diffExtraChildren: false, diffExtraAttributes: false }, {
name: 'div', attribs: {}, children: [
{
name: 'span',
attribs: {},
children: [ 'two' ]
}
]
}, 'to satisfy', {
found: true,
bestMatch: {
weight: 0
}
});
});
});

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