mirror of
https://github.com/nextcloud/server.git
synced 2026-06-13 18:50:47 -04:00
fix(jest): nextcloud/files Node structuredClone
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
This commit is contained in:
parent
da33159f1e
commit
709b05e77d
2 changed files with 15 additions and 1 deletions
14
__tests__/FixJSDOMEnvironment.ts
Normal file
14
__tests__/FixJSDOMEnvironment.ts
Normal file
|
|
@ -0,0 +1,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
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -57,7 +57,7 @@ const config: Config = {
|
|||
clearMocks: true,
|
||||
setupFilesAfterEnv: ['<rootDir>/__tests__/jest-setup.ts'],
|
||||
|
||||
testEnvironment: 'jest-environment-jsdom',
|
||||
testEnvironment: './__tests__/FixJSDOMEnvironment.ts',
|
||||
preset: 'ts-jest/presets/js-with-ts',
|
||||
|
||||
roots: [
|
||||
|
|
|
|||
Loading…
Reference in a new issue