mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 17:05:18 +00:00
42b3e5602e
# Checklist for submitter If some of the following don't apply, delete the relevant line. - [x] Changes file added for user-visible changes in `changes/` or `orbit/changes/`. See [Changes files](https://fleetdm.com/docs/contributing/committing-changes#changes-files) for more information. - [x] Added/updated tests - [x] Manual QA for all new/changed functionality
16 lines
517 B
TypeScript
16 lines
517 B
TypeScript
// Adapted from https://github.com/jsdom/jsdom/issues/1724#issuecomment-1446858041
|
|
|
|
import JSDOMEnvironment from "jest-environment-jsdom";
|
|
|
|
export default class JSDOMWithFetch extends JSDOMEnvironment {
|
|
constructor(...args: ConstructorParameters<typeof JSDOMEnvironment>) {
|
|
super(...args);
|
|
|
|
// Fixes for missing fetch (https://github.com/jsdom/jsdom/issues/1724)
|
|
this.global.fetch = fetch;
|
|
this.global.Headers = Headers;
|
|
this.global.Request = Request;
|
|
this.global.Response = Response;
|
|
}
|
|
}
|