43 lines
1.1 KiB
JavaScript
43 lines
1.1 KiB
JavaScript
module.exports = {
|
|
moduleFileExtensions: [
|
|
'js',
|
|
'jsx',
|
|
'ts',
|
|
'json',
|
|
'vue',
|
|
],
|
|
transform: {
|
|
'\\.(gql|graphql)$': '@graphql-tools/jest-transform',
|
|
'^.+\\.js$': 'babel-jest',
|
|
'^.+\\.ts$': 'babel-jest',
|
|
'^.+\\.vue$': '@vue/vue3-jest',
|
|
'.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$': 'jest-transform-stub',
|
|
},
|
|
modulePaths: [
|
|
'<rootDir>/src',
|
|
'<rootDir>/node_modules',
|
|
],
|
|
transformIgnorePatterns: [
|
|
'/node_modules/',
|
|
],
|
|
moduleNameMapper: {
|
|
'^@/(.*)$': '<rootDir>/src/$1',
|
|
'^gql/(.*)$': '<rootDir>/src/graphql/gql/$1',
|
|
},
|
|
snapshotSerializers: [
|
|
'<rootDir>/node_modules/jest-serializer-vue',
|
|
],
|
|
testEnvironment: 'jsdom',
|
|
testEnvironmentOptions: {
|
|
url: 'http://localhost/',
|
|
customExportConditions: ['node', 'node-addons'] // needed according to https://github.com/vuejs/vue-jest/issues/479
|
|
},
|
|
testMatch: [
|
|
'**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)',
|
|
],
|
|
watchPlugins: [
|
|
'jest-watch-typeahead/filename',
|
|
'jest-watch-typeahead/testname',
|
|
],
|
|
};
|