diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2023-06-21 11:36:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-21 11:36:11 +0200 |
commit | 32bbe3db810bb10bde956b1030fb85d5aae16e4c (patch) | |
tree | 8b9f105dfbbf322d925fe81f6cd4bfc4035c96c9 /jest.config.ts | |
parent | 5fb7ea22be0814eb8e1e1e0f2df6032ef53983cc (diff) | |
parent | a70aa61dffe7fc800c048af2c365076f43934767 (diff) | |
download | nextcloud-server-32bbe3db810bb10bde956b1030fb85d5aae16e4c.tar.gz nextcloud-server-32bbe3db810bb10bde956b1030fb85d5aae16e4c.zip |
Merge pull request #38806 from nextcloud/feat/f2v/actions-1
Diffstat (limited to 'jest.config.ts')
-rw-r--r-- | jest.config.ts | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/jest.config.ts b/jest.config.ts new file mode 100644 index 00000000000..4a3816d9da6 --- /dev/null +++ b/jest.config.ts @@ -0,0 +1,73 @@ +/** + * @copyright Copyright (c) 2020 Marco Ambrosini <marcoambrosini@pm.me> + * + * @author Marco Ambrosini <marcoambrosini@pm.me> + * + * @license GNU AGPL version 3 or any later version + * + * 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 type { Config } from 'jest' + +// TODO: find a way to consolidate this in one place, with webpack.common.js +const ignorePatterns = [ + '@juliushaertl', + '@mdi/svg', + '@nextcloud/vue', + 'ansi-regex', + 'char-regex', + 'splitpanes', + 'string-length', + 'strip-ansi', + 'tributejs', + 'vue-material-design-icons', +] + +const config: Config = { + testMatch: ['<rootDir>/**/*.(spec|test).(ts|js)'], + + clearMocks: true, + setupFilesAfterEnv: ['<rootDir>/__tests__/jest-setup.ts'], + + testEnvironment: 'jest-environment-jsdom', + preset: 'ts-jest/presets/js-with-ts', + + roots: [ + '<rootDir>/__mocks__', + '<rootDir>/__tests__', + '<rootDir>/apps', + '<rootDir>/core', + ], + + transform: { + // process `*.js` files with `babel-jest` + '^.+\\.js$': 'babel-jest', + '^.+\\.vue$': '@vue/vue2-jest', + }, + transformIgnorePatterns: [ + 'node_modules/(?!(' + ignorePatterns.join('|') + ')/)', + ], + + // Allow mocking svg files + moduleNameMapper: { + '^.+\\.svg(\\?raw)?$': '<rootDir>/__mocks__/svg.js', + }, + modulePathIgnorePatterns: [ + '<rootDir>/apps2/', + '<rootDir>/apps-extra/', + ], +} + +export default config |