Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

assert-html-equal

gakimball189MIT1.0.0

Check if two HTML strings are identical in structure.

assert, html, testing

readme

Build Status npm version Dependency Status

assert-html-equal

Checks that two HTML strings are equal. The two strings are pretty-formatted before being compared, to ensure differences in whitespace, tabs, etc. don't mess up the comparison.

Usage

npm install assert-html-equal
var htmlEqual = require('assert-html-equal');

// Works great with multiline strings!
var actual = '<table></table>';
var expected = `
  <table></table>
`;
var message = 'HTML output is correct';

htmlEqual(actual, expected, message);

Local Development

git clone https://github.com/gakimball/assert-html-equal
cd assert-html-equal
npm install
npm test