diff options
Diffstat (limited to '__tests__')
-rw-r--r-- | __tests__/jest-setup.ts | 12 | ||||
-rw-r--r-- | __tests__/mock-window.js | 9 | ||||
-rw-r--r-- | __tests__/setup-global.js | 7 | ||||
-rw-r--r-- | __tests__/setup-testing-library.js | 6 | ||||
-rw-r--r-- | __tests__/tsconfig.json | 6 |
5 files changed, 22 insertions, 18 deletions
diff --git a/__tests__/jest-setup.ts b/__tests__/jest-setup.ts deleted file mode 100644 index 7ee7b7dcac8..00000000000 --- a/__tests__/jest-setup.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -import '@testing-library/jest-dom' - -// Mock `window.location` with Jest spies and extend expect -import 'jest-location-mock' - -// Mock `window.fetch` with Jest -import 'jest-fetch-mock' diff --git a/__tests__/mock-window.js b/__tests__/mock-window.js new file mode 100644 index 00000000000..e0c8607dc22 --- /dev/null +++ b/__tests__/mock-window.js @@ -0,0 +1,9 @@ +/** + * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later + */ +window.OC = { ...window.OC } +window.OCA = { ...window.OCA } +window.OCP = { ...window.OCP } + +window._oc_webroot = '' diff --git a/__tests__/setup-global.js b/__tests__/setup-global.js new file mode 100644 index 00000000000..93230b0deab --- /dev/null +++ b/__tests__/setup-global.js @@ -0,0 +1,7 @@ +/** + * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: CC0-1.0 + */ +export function setup() { + process.env.TZ = 'UTC' +} diff --git a/__tests__/setup-testing-library.js b/__tests__/setup-testing-library.js new file mode 100644 index 00000000000..190e6f93e7c --- /dev/null +++ b/__tests__/setup-testing-library.js @@ -0,0 +1,6 @@ +/** + * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: CC0-1.0 + */ +import '@testing-library/jest-dom/vitest' +import 'core-js/stable/index.js' diff --git a/__tests__/tsconfig.json b/__tests__/tsconfig.json deleted file mode 100644 index 489da623e1b..00000000000 --- a/__tests__/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "../tsconfig.json", - "compilerOptions": { - "verbatimModuleSyntax": false - } -} |