|
|
@ -121,13 +121,12 @@ export function normalize_new_line(html) {
|
|
|
|
return html.replace(/\r\n/g, '\n');
|
|
|
|
return html.replace(/\r\n/g, '\n');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export function setup_html_equal() {
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @param {string} actual
|
|
|
|
* @param {string} actual
|
|
|
|
* @param {string} expected
|
|
|
|
* @param {string} expected
|
|
|
|
* @param {string} [message]
|
|
|
|
* @param {string} [message]
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
const assert_html_equal = (actual, expected, message) => {
|
|
|
|
export const assert_html_equal = (actual, expected, message) => {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
assert.deepEqual(normalize_html(window, actual), normalize_html(window, expected), message);
|
|
|
|
assert.deepEqual(normalize_html(window, actual), normalize_html(window, expected), message);
|
|
|
|
} catch (e) {
|
|
|
|
} catch (e) {
|
|
|
@ -144,7 +143,7 @@ export function setup_html_equal() {
|
|
|
|
* @param {{ preserveComments?: boolean, withoutNormalizeHtml?: boolean }} param2
|
|
|
|
* @param {{ preserveComments?: boolean, withoutNormalizeHtml?: boolean }} param2
|
|
|
|
* @param {string} [message]
|
|
|
|
* @param {string} [message]
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
const assert_html_equal_with_options = (
|
|
|
|
export const assert_html_equal_with_options = (
|
|
|
|
actual,
|
|
|
|
actual,
|
|
|
|
expected,
|
|
|
|
expected,
|
|
|
|
{ preserveComments, withoutNormalizeHtml },
|
|
|
|
{ preserveComments, withoutNormalizeHtml },
|
|
|
@ -172,12 +171,3 @@ export function setup_html_equal() {
|
|
|
|
throw e;
|
|
|
|
throw e;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
|
|
|
assert_html_equal,
|
|
|
|
|
|
|
|
assert_html_equal_with_options
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Common case without options
|
|
|
|
|
|
|
|
export const { assert_html_equal, assert_html_equal_with_options } = setup_html_equal();
|
|
|
|
|
|
|
|