(
actual,
expected,
{ preserveComments, withoutNormalizeHtml },
message
)
| 163 | * @param {string} [message] |
| 164 | */ |
| 165 | export const assert_html_equal_with_options = ( |
| 166 | actual, |
| 167 | expected, |
| 168 | { preserveComments, withoutNormalizeHtml }, |
| 169 | message |
| 170 | ) => { |
| 171 | try { |
| 172 | assert.deepEqual( |
| 173 | withoutNormalizeHtml |
| 174 | ? normalize_new_line(actual.trim()).replace( |
| 175 | /(<!(--)?.*?\2>)/g, |
| 176 | preserveComments !== false ? '$1' : '' |
| 177 | ) |
| 178 | : normalize_html(window, actual.trim(), { preserveComments }), |
| 179 | withoutNormalizeHtml |
| 180 | ? normalize_new_line(expected.trim()).replace( |
| 181 | /(<!(--)?.*?\2>)/g, |
| 182 | preserveComments !== false ? '$1' : '' |
| 183 | ) |
| 184 | : normalize_html(window, expected.trim(), { preserveComments }), |
| 185 | message |
| 186 | ); |
| 187 | } catch (e) { |
| 188 | if (Error.captureStackTrace) |
| 189 | Error.captureStackTrace(/** @type {Error} */ (e), assert_html_equal_with_options); |
| 190 | throw e; |
| 191 | } |
| 192 | }; |
no test coverage detected