A QUnit plugin for assertion methods to compare two HTML strings for equality after a rigorous normalization process.
MIT License
This plugin for QUnit adds htmlEqual
and notHtmlEqual
(plus alias htmlNotEqual
) assertion methods to test that two HTML strings are equivalent (or not) after a rigorous normalization process.
assert.htmlEqual(actual, expected [, message]);
assert.notHtmlEqual(actual, expected [, message]); // Alias: `assert.htmlNotEqual`
test('Example unit test', function(assert) {
assert.htmlEqual('<B TITLE=test>test</B>', '<b title="test">test</b>');
assert.notHtmlEqual('<br />', '<hr />');
});
For more examples, refer to the unit tests.
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using grunt.
Copyright (c) 2013-2016 James M. Greene Licensed under the MIT license.