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

html-normalizer

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

html-normalizer - npm Package Compare versions

Comparing version 1.0.9 to 1.1.0

2

package.json
{
"name": "html-normalizer",
"version": "1.0.9",
"version": "1.1.0",
"description": "Used to normalize html and jsx to strings so they can be used in assertions.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -26,3 +26,3 @@ # Normalizer (html-normalizer)

Overtime this becomes difficult read. Especially when testing large DOM trees. Here is an alternate approach:
Overtime this becomes to difficult read. Especially when testing large DOM trees. Here is an alternate approach:

@@ -32,5 +32,5 @@ ```javascript

var expectedNode = document.createElement("div");
expectedHTML = "<span style='background: red; display: none' class='some-class'>";
expectedHTML = "<div style='background: red; display: none' class='some-class'>";
expectedHTML += "<span>Bob</span>";
expectedHTML += "</span>";
expectedHTML += "</div>";
expectedNode.innerHTML = expectedHTML;

@@ -44,5 +44,5 @@ expect(dom.isNodeEqual(expectedNode)).toBeTruthy();

var dom = document.getElementById("testElement");
var expectedHTML = "<span style='background: red; display: none' class='some-class'>";
var expectedHTML = "<div style='background: red; display: none' class='some-class'>";
expectedHTML += "<span>Bob</span>";
expectedHTML += "</span>";
expectedHTML += "</div>";

@@ -67,3 +67,5 @@ expect(dom.outerHTML).toEqual(expectedHTML);

var dom = document.getElementById("testElement");
var expectedHTML = "<span style='display: none' class='some-class'><span>Bob</span></span>";
var expectedHTML = "<div style='display: none' class='some-class'>";
expectedHTML += "<span>Bob</span>";
expectedHTML += "</div>";

@@ -86,5 +88,5 @@ var actual = normalizer.domNode(dom); //method to normalize a DOM node

var expectedHTML = (
<span style={{display: none}} className='some-class'>
<div style={{display: none}} className='some-class'>
<span>Bob</span>
</span>
</div>
);

@@ -91,0 +93,0 @@

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