cosmos-explorer/src/setupTests.ts

19 lines
718 B
TypeScript
Raw Normal View History

import { configure } from "enzyme";
2021-03-29 19:31:52 +01:00
import Adapter from "enzyme-adapter-react-16";
import "jest-canvas-mock";
import { initializeIcons } from "office-ui-fabric-react";
2021-03-29 19:31:52 +01:00
import { TextDecoder, TextEncoder } from "util";
configure({ adapter: new Adapter() });
initializeIcons();
if (typeof window.URL.createObjectURL === "undefined") {
Object.defineProperty(window.URL, "createObjectURL", { value: () => {} });
}
// TODO Remove when jquery and documentdbclient SDK are removed
(<any>window).$ = (<any>window).jQuery = require("jquery");
(<any>global).$ = (<any>global).$.jQuery = require("jquery");
require("jquery-ui-dist/jquery-ui");
2021-03-29 19:31:52 +01:00
(<any>global).TextEncoder = TextEncoder;
(<any>global).TextDecoder = TextDecoder;