Commit 79d14ca2 authored by David Sveningsson's avatar David Sveningsson
Browse files

feat(jest): better compatibility with jest in node environment

parent 491f0df3
Pipeline #311507619 passed with stages
in 9 minutes and 17 seconds
......@@ -13,6 +13,7 @@ interface TokenMatcher {
data?: any;
}
/* istanbul ignore next: covered by compatibility tests but not a single pass */
const diff = jestDiff?.diff ?? jestDiff;
declare global {
......@@ -174,7 +175,7 @@ function toHTMLValidate(
arg2?: string
): jest.CustomMatcherResult {
// @ts-ignore DOM library not available
if (actual instanceof HTMLElement) {
if (typeof HTMLElement !== "undefined" && actual instanceof HTMLElement) {
actual = actual.outerHTML;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment