summaryrefslogtreecommitdiffstats
path: root/jest.config.ts
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@protonmail.com>2023-06-20 12:12:56 +0200
committerJohn Molakvoæ <skjnldsv@protonmail.com>2023-06-21 09:20:50 +0200
commit45ecd55d89ec61771ebaf454f896344197b5cbe2 (patch)
tree9fc31a99f970e69ce8095cbb434e7d1031a2f0b9 /jest.config.ts
parent70ee8de0aba8eb3467919e0b2491af8be8869e77 (diff)
downloadnextcloud-server-45ecd55d89ec61771ebaf454f896344197b5cbe2.tar.gz
nextcloud-server-45ecd55d89ec61771ebaf454f896344197b5cbe2.zip
feat: prepare jest coverage support
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'jest.config.ts')
-rw-r--r--jest.config.ts35
1 files changed, 19 insertions, 16 deletions
diff --git a/jest.config.ts b/jest.config.ts
index 37432033242..4a3816d9da6 100644
--- a/jest.config.ts
+++ b/jest.config.ts
@@ -37,34 +37,37 @@ const ignorePatterns = [
const config: Config = {
testMatch: ['<rootDir>/**/*.(spec|test).(ts|js)'],
- modulePathIgnorePatterns: [
- '<rootDir>/apps2/',
- '<rootDir>/apps-extra/',
- ],
- transformIgnorePatterns: [
- 'node_modules/(?!(' + ignorePatterns.join('|') + ')/)',
- ],
- clearMocks: true,
- collectCoverageFrom: [
- '<rootDir>/**/*.{js,vue}',
- ],
+ clearMocks: true,
setupFilesAfterEnv: ['<rootDir>/__tests__/jest-setup.ts'],
testEnvironment: 'jest-environment-jsdom',
preset: 'ts-jest/presets/js-with-ts',
- // Allow mocking svg files
- moduleDirectories: ['node_modules', '<rootDir>/'],
- moduleNameMapper: {
- '^.+\\.svg(\\?raw)?$': '<rootDir>/__mocks__/svg.js',
- },
+ 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