mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-19 02:21:32 +08:00
add mock IntersectionObserver
This commit is contained in:
@@ -2,12 +2,21 @@ import "jsdom-worker";
|
||||
|
||||
import JSDOMEnvironment from "jest-environment-jsdom";
|
||||
|
||||
class MockObserver {
|
||||
constructor(...args) {}
|
||||
|
||||
observe(...args) {}
|
||||
unobserve(...args) {}
|
||||
}
|
||||
|
||||
export default class CustomJSDOMEnvironment extends JSDOMEnvironment {
|
||||
constructor(...args) {
|
||||
super(...args);
|
||||
|
||||
this.global.Worker = Worker;
|
||||
|
||||
this.global.IntersectionObserver = MockObserver;
|
||||
|
||||
// FIXME https://github.com/jsdom/jsdom/issues/3363
|
||||
this.global.structuredClone = structuredClone;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user