mirror of
https://github.com/nextcloud/server.git
synced 2026-06-09 08:44:07 -04:00
fix(jest): nextcloud/files Node structuredClone
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
This commit is contained in:
parent
f1fe382aca
commit
dc25343387
2 changed files with 19 additions and 1 deletions
18
__tests__/FixJSDOMEnvironment.ts
Normal file
18
__tests__/FixJSDOMEnvironment.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
/**
|
||||
* SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
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
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -43,7 +43,7 @@ const config: Config = {
|
|||
'<rootDir>/__tests__/mock-window.js',
|
||||
],
|
||||
|
||||
testEnvironment: 'jest-environment-jsdom',
|
||||
testEnvironment: './__tests__/FixJSDOMEnvironment.ts',
|
||||
preset: 'ts-jest/presets/js-with-ts',
|
||||
|
||||
roots: [
|
||||
|
|
|
|||
Loading…
Reference in a new issue