2020-03-18 20:26:04 +03:00
|
|
|
/*
|
|
|
|
* @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/>.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2021-06-10 15:33:27 +03:00
|
|
|
// TODO: find a way to consolidate this in one place, with webpack.common.js
|
|
|
|
const ignorePatterns = [
|
|
|
|
'vue-material-design-icons',
|
|
|
|
'@juliushaertl',
|
|
|
|
'tributejs',
|
2021-06-10 16:10:46 +03:00
|
|
|
'@nextcloud/vue',
|
2021-06-10 15:33:27 +03:00
|
|
|
'splitpanes',
|
|
|
|
'string-length',
|
|
|
|
'strip-ansi',
|
|
|
|
'ansi-regex',
|
|
|
|
'char-regex',
|
|
|
|
]
|
|
|
|
|
2020-03-18 11:27:43 +03:00
|
|
|
module.exports = {
|
2020-03-18 20:26:04 +03:00
|
|
|
preset: '@vue/cli-plugin-unit-jest/presets/no-babel',
|
2020-03-24 08:48:09 +03:00
|
|
|
// Allow tests in the src and in tests/unit folders
|
2020-03-24 09:52:18 +03:00
|
|
|
testMatch: ['<rootDir>/src/**/*.(spec|test).(ts|js)'],
|
2021-05-06 11:08:31 +03:00
|
|
|
transformIgnorePatterns: [
|
2021-06-10 15:33:27 +03:00
|
|
|
'node_modules/(?!(' + ignorePatterns.join('|') + ')/)',
|
2021-05-06 11:08:31 +03:00
|
|
|
],
|
2021-04-23 15:57:39 +03:00
|
|
|
resetMocks: false,
|
|
|
|
setupFiles: ['jest-localstorage-mock'],
|
2021-04-27 10:21:07 +03:00
|
|
|
setupFilesAfterEnv: [
|
|
|
|
'<rootDir>/src/test-setup.js',
|
2021-04-30 16:19:46 +03:00
|
|
|
'jest-mock-console/dist/setupTestFramework.js',
|
2021-04-27 10:21:07 +03:00
|
|
|
],
|
2021-05-11 13:22:46 +03:00
|
|
|
collectCoverageFrom: [
|
|
|
|
'<rootDir>/src/**/*.{js,vue}',
|
|
|
|
],
|
2021-04-22 18:38:16 +03:00
|
|
|
transform: {
|
|
|
|
// process `*.js` files with `babel-jest`
|
|
|
|
'.*\\.(js)$': 'babel-jest',
|
2021-10-11 03:25:28 +03:00
|
|
|
'src/utils/media/effects/virtual-background/vendor/*': 'jest-transform-stub',
|
2021-04-22 18:38:16 +03:00
|
|
|
},
|
2020-03-18 11:27:43 +03:00
|
|
|
}
|