From 50598f0b65b88c9829aa347f15166adc49dd3e51 Mon Sep 17 00:00:00 2001 From: Maksim Sukharev Date: Sun, 8 Oct 2023 14:06:47 +0200 Subject: [PATCH] chore(deps): update ignore patterns for jest Signed-off-by: Maksim Sukharev --- jest.config.js | 51 +++++++++++++--------------- src/types/vendor/@nextcloud/vue.d.ts | 3 -- 2 files changed, 23 insertions(+), 31 deletions(-) diff --git a/jest.config.js b/jest.config.js index 3c5803c2fe..6276b756ec 100644 --- a/jest.config.js +++ b/jest.config.js @@ -22,43 +22,38 @@ const { resolve } = require('node:path') +// Listed packages will be transformed with babel-jest // TODO: find a way to consolidate this in one place, with webpack.common.js const ignorePatterns = [ - '(vue-material-design-icons)', - '(@juliushaertl)', - '(tributejs)', - '(@nextcloud/vue)', - '(splitpanes)', - '(string-length)', - '(strip-ansi)', - '(ansi-regex)', - '(char-regex)', - '(uuid)', - '(unist*)', - '(unified)', - '(bail)', - '(remark*)', - '(is-*)', - '(trough)', - '(vfile)', - '(mdast*)', - '(micromark)', - '(decode-named-character-reference)', - '(trim-lines)', - '(rehype*)', - '(hast-*)', - '(property-information)', - '(space-separated-tokens)', - '(comma-separated-tokens)', - '(web-namespaces)', + 'bail', + 'comma-separated-tokens', + 'decode-named-character-reference', + 'devlop', + 'escape-string-regexp', + 'hast-.*', + 'is-.*', + 'mdast-.*', + 'micromark', + 'property-information', + 'rehype-.*', + 'remark-.*', + 'space-separated-tokens', + 'trim-lines', + 'trough', + 'unified', + 'unist-.*', + 'vfile', + 'vue-material-design-icons', + 'web-namespaces', ] module.exports = { // Allow tests in the src and in tests/unit folders testMatch: ['/src/**/*.(spec|test).(ts|js)'], + // Transform packages from top-level and nested 'node_modules' transformIgnorePatterns: [ - 'node_modules/(?!' + ignorePatterns.join('|') + '/)', + `/node_modules/(?!(?:.*\\/node_modules\\/)?(?:${ignorePatterns.join('|')}))`, ], resetMocks: false, setupFiles: ['jest-localstorage-mock'], diff --git a/src/types/vendor/@nextcloud/vue.d.ts b/src/types/vendor/@nextcloud/vue.d.ts index 4691ce4de6..905f661371 100644 --- a/src/types/vendor/@nextcloud/vue.d.ts +++ b/src/types/vendor/@nextcloud/vue.d.ts @@ -1,4 +1 @@ declare module '@nextcloud/vue/dist/Directives/Tooltip.vue'; -declare module '@nextcloud/vue/dist/Components/Button.vue'; -declare module '@nextcloud/vue/dist/Components/NcActions.vue'; -declare module '@nextcloud/vue/dist/Components/NcActionButton.vue';