{"id":15395819,"url":"https://github.com/mvasilkov/assert-equal-html","last_synced_at":"2025-04-16T00:16:02.523Z","repository":{"id":57185002,"uuid":"259578232","full_name":"mvasilkov/assert-equal-html","owner":"mvasilkov","description":"Assert the equality of two HTML fragments","archived":false,"fork":false,"pushed_at":"2020-05-18T18:09:44.000Z","size":19,"stargazers_count":6,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-16T00:15:56.857Z","etag":null,"topics":["assert","equality","html","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/assert-equal-html","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mvasilkov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-28T08:34:01.000Z","updated_at":"2024-10-24T07:24:13.000Z","dependencies_parsed_at":"2022-09-17T07:51:14.127Z","dependency_job_id":null,"html_url":"https://github.com/mvasilkov/assert-equal-html","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvasilkov%2Fassert-equal-html","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvasilkov%2Fassert-equal-html/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvasilkov%2Fassert-equal-html/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvasilkov%2Fassert-equal-html/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mvasilkov","download_url":"https://codeload.github.com/mvasilkov/assert-equal-html/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249173086,"owners_count":21224484,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["assert","equality","html","typescript"],"created_at":"2024-10-01T15:29:39.754Z","updated_at":"2025-04-16T00:16:02.493Z","avatar_url":"https://github.com/mvasilkov.png","language":"JavaScript","readme":"assert-equal-html\n===\n\nAssert the equality of two HTML fragments\n\n[![npm][npm-badge]][npm-url]\n[![dependencies][dependencies-badge]][dependencies-url]\n\n---\n\nInstallation\n---\n\n```sh\nnpm add assert-equal-html\n```\n\nUsage\n---\n\n```javascript\nconst { assertEqual } = require('assert-equal-html')\n\nassertEqual(\n    '\u003cbutton type=\"button\" class=\"btn btn-link\"\u003eLink\u003c/button\u003e',\n    '\u003cbutton class=\"btn-link btn\" type=\"button\"\u003eLink\u003c/button\u003e')\n```\n\nThe comparison rules are as follows:\n\n- The DOCTYPE, if present, is ignored\n- HTML comments are also ignored\n- Attributes and class names are sorted\n- ASCII whitespace is stripped and collapsed\n\n\u003e [ASCII whitespace][1] is U+0009 TAB, U+000A LF, U+000C FF, U+000D CR, or U+0020 SPACE.\n\u003e\n\u003e To [strip and collapse ASCII whitespace][2] in a string, replace any sequence of one or more\n\u003e consecutive code points that are ASCII whitespace in the string with a single U+0020 SPACE\n\u003e code point, and then remove any leading and trailing ASCII whitespace from that string.\n\n[1]: https://infra.spec.whatwg.org/#ascii-whitespace\n[2]: https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace\n\nSyntax\n---\n\n**`assertEqual(actual, expected[, message])`**\n\nTests HTML equality between the `actual` and `expected` parameters.\n\n**`assertNotEqual(actual, expected[, message])`**\n\nTests HTML inequality between the `actual` and `expected` parameters.\n\nLicense\n---\n\nMIT\n\n[npm-badge]: https://img.shields.io/npm/v/assert-equal-html.svg?style=flat\n[npm-url]: https://www.npmjs.com/package/assert-equal-html\n[dependencies-badge]: https://img.shields.io/librariesio/release/npm/assert-equal-html?style=flat\n[dependencies-url]: https://www.npmjs.com/package/assert-equal-html?activeTab=dependencies\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmvasilkov%2Fassert-equal-html","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmvasilkov%2Fassert-equal-html","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmvasilkov%2Fassert-equal-html/lists"}