Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .nextcloudignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ codecov.yml
.gitignore
.hg
/issue_template.md
/jest.config.js
/krankerl.toml
/l10n/no-php
/.php-cs-fixer.dist.php
Expand All @@ -41,5 +42,3 @@ codecov.yml
/vendor/*/*/tests
/vendor/*/*/test_data
/webpack.*
/vitest.config.*
/patches
46 changes: 46 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/**
* SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
module.exports = {
preset: 'ts-jest',
testEnvironment: './src/tests/jsdom-structured-clone-env.js',
moduleFileExtensions: [
'js',
'jsx',
'json',
// tell Jest to handle *.vue files
'vue',
],
transform: {
// process *.vue files with vue-jest
'^.+\\.vue$': require.resolve('@vue/vue2-jest'),
'.+\\.(css|styl|less|sass|scss|jpg|jpeg|png|svg|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga|avif)$':
require.resolve('jest-transform-stub'),
'^.+\\.jsx?$': require.resolve('babel-jest'),
},
// support the same @ -> src alias mapping in source code
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
},
// serializer for snapshots
snapshotSerializers: [
'jest-serializer-vue',
],
testMatch: [
'**/tests/unit/**/*.spec.[jt]s?(x)',
'**/__tests__/*.[jt]s?(x)',
],
// https://github.com/facebook/jest/issues/6766
testEnvironmentOptions: {
url: 'http://localhost/',
},
watchPlugins: [
require.resolve('jest-watch-typeahead/filename'),
require.resolve('jest-watch-typeahead/testname'),
],
transformIgnorePatterns: ['/node_modules/(?!@ckeditor)/.+\\.js$'],
setupFiles: [
'<rootDir>/src/tests/setup.js',
],
}
Loading
Loading