Co-authored-by: Ivan Akulov <mail@iamakulov.com> Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Ivan Akulov <iamakulov@outlook.com> Co-authored-by: Aishwarya UR <aishwarya@appsmith.com> Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com> Co-authored-by: somangshu <somangshu.goswami1508@gmail.com>
14 lines
389 B
TypeScript
14 lines
389 B
TypeScript
//@ts-expect-error no types.
|
|
import * as documentMock from "linkedom/worker";
|
|
|
|
export default function () {
|
|
for (const [key, value] of Object.entries(documentMock)) {
|
|
//@ts-expect-error no types
|
|
self[key] = value;
|
|
}
|
|
const dom = documentMock.parseHTML(`<!DOCTYPE html><body></body>`);
|
|
self.window = dom.window;
|
|
self.document = dom.window.document;
|
|
self.window = self;
|
|
}
|