aboutsummaryrefslogtreecommitdiffstats
path: root/__tests__/FixJSDOMEnvironment.ts
blob: 974a06da85821d1fc68ba7b418cab39a132f816b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import JSDOMEnvironment from 'jest-environment-jsdom'

// https://github.com/facebook/jest/blob/v29.4.3/website/versioned_docs/version-29.4/Configuration.md#testenvironment-string
export default class FixJSDOMEnvironment extends JSDOMEnvironment {

	constructor(...args: ConstructorParameters<typeof JSDOMEnvironment>) {
		super(...args)

		// https://github.com/jsdom/jsdom/issues/3363
		// 31 ad above switched to vitest and don't have that issue
		this.global.structuredClone = structuredClone
	}

}