Skip to content

Commit

Permalink
Add workaround for MutationRecord not available globally
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekmaj committed Oct 3, 2023
1 parent 8a95c2b commit ac46f40
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/useMutationObserver.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import { renderHook } from '@testing-library/react-hooks';

import useMutationObserver from './useMutationObserver.js';

// See https://github.com/capricorn86/happy-dom/issues/1112
import MutationRecord from 'happy-dom/lib/mutation-observer/MutationRecord.js';

const itIfDocumentDefined = typeof document !== 'undefined' ? it : it.skip;

async function waitForAsync() {
Expand Down

0 comments on commit ac46f40

Please sign in to comment.