diff options
Diffstat (limited to '__tests__')
-rw-r--r-- | __tests__/FileSystemAPIUtils.ts | 4 | ||||
-rw-r--r-- | __tests__/jest-setup.ts | 29 | ||||
-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 |
6 files changed, 26 insertions, 35 deletions
diff --git a/__tests__/FileSystemAPIUtils.ts b/__tests__/FileSystemAPIUtils.ts index efb273e9dcd..d03bbf2d586 100644 --- a/__tests__/FileSystemAPIUtils.ts +++ b/__tests__/FileSystemAPIUtils.ts @@ -1,3 +1,7 @@ +/** + * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later + */ import { basename } from 'node:path' import mime from 'mime' diff --git a/__tests__/jest-setup.ts b/__tests__/jest-setup.ts deleted file mode 100644 index 47df5dabffe..00000000000 --- a/__tests__/jest-setup.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @copyright 2021 François Freitag <mail@franek.fr> - * - * @author François Freitag <mail@franek.fr> - * - * @license AGPL-3.0-or-later - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - */ - -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 - } -} |