-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
67 lines (57 loc) · 2.82 KB
/
jest.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
module.exports = {
preset: 'jest-puppeteer',
// moduleFileExtensions: ['js', 'ts', 'vue'],
// testEnvironment: 'jsdom',
// transform: {
// // in app and in jest, as convention, anything that has /snippets/ as part of it's path
// // is loaded in as a raw string
// '\\/snippets\\/': '<rootDir>/test/unit/rawTransform.js',
// '^.+\\.vue$': '@vue/vue2-jest',
// '^.+\\.jsx?$': 'babel-jest',
// // all non-inline svgs in app are transformed to a vue component
// // this does not actually align with what the app does, so it's not clear
// // why we are doing this.
// '^.+\\.svg$': '<rootDir>/test/unit/svgTransform.js',
// // .pngs which get imported into another file have a special transform
// // which will resolve to just the base filename. We only have .pngs doing this
// // right now, but if we want, we could do the same for .svg, .jpg, etc
// '^.+\\.png$': '<rootDir>/test/unit/filenameTransform.js',
// '^.+\\.tsx?$': ['ts-jest', { isolatedModules: true }]
// },
// transformIgnorePatterns: ['/node_modules/(?!(lottie-vuejs|uuid|pinia))'],
moduleNameMapper: {
// // use the common.js build of 'vue'
// '^vue$': 'vue/dist/vue.common.js',
// // Imports ending with .svg?inline are remapped into a very basic vue
// // components. In app, they are actually inlined as components rendering the
// // svg as their template, but since they are stubs in snapshots, this is good
// // enough.
// 'svg\\?inline': '<rootDir>/test/unit/vueComponentMock.js',
// // all workers, designated by ?worker resource query in import, are mocked
// '\\?worker$': '<rootDir>/src/__mocks__/workerMock.js',
// // reproduce storybook aliasing from the main app
// '^@/storybook/(.*)$': '<rootDir>/config/storybook/$1',
// // all imports of these specified types are replaced by a simple mock module
// '^.+.(css|scss|ttf|woff|woff2)$': '<rootDir>/test/unit/resourceMock.js',
// // reproduce main app @/ aliasing
'^@/(.*)$': '<rootDir>/$1',
'^@fixtures/(.*)$': '<rootDir>/fixtures/$1',
// // reproduce main app test/ aliasing
// '^test/(.*)$': '<rootDir>/test/$1',
// // forces usage of commonjs for axios,
// // so the http adapter gets loaded in in tests
// '^axios$': require.resolve('axios')
},
// snapshotSerializers: ['jest-serializer-vue'],
// snapshotResolver: './snapshotResolver.js',
// testMatch: [
// '**/src/**/*.(spec|test).(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)',
// '**/test/unit/**/*.test.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)',
// '**/test/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)'
// ],
setupFiles: ['./jest.setup.js'],
// watchPlugins: [
// require.resolve('jest-watch-typeahead/filename'),
// require.resolve('jest-watch-typeahead/testname')
// ]
}