forked from algolia/instantsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
69 lines (67 loc) · 1.85 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
68
69
// @ts-check
/** @type {import('@jest/types').Config.InitialOptions} */
const config = {
rootDir: process.cwd(),
testRunner: 'jest-circus',
testEnvironment: 'node',
setupFilesAfterEnv: ['./tests/utils/setupTests.ts'],
testPathIgnorePatterns: [
'<rootDir>/node_modules/',
'<rootDir>/packages/*/node_modules/',
'<rootDir>/packages/*/dist*',
'<rootDir>/tests/e2e/*',
'<rootDir>/examples/',
'<rootDir>/packages/algoliasearch-helper',
'<rootDir>/packages/create-instantsearch-app',
'<rootDir>/packages/react-instantsearch-router-nextjs',
'/__utils__/',
],
watchPathIgnorePatterns: [
'<rootDir>/packages/*/cjs',
'<rootDir>/packages/*/dist',
'<rootDir>/packages/*/es',
'<rootDir>/packages/*/stories',
'<rootDir>/examples',
'<rootDir>/website',
],
watchPlugins: [
'jest-watch-typeahead/filename',
'jest-watch-typeahead/testname',
],
transformIgnorePatterns: ['node_modules/(?!(search-insights)/)'],
transform: {
'^.+\\.(j|t)sx?$': 'babel-jest',
'^.+\\.vue$': '@vue/vue2-jest',
},
moduleFileExtensions: ['tsx', 'ts', 'js', 'vue'],
moduleNameMapper: {
'^react-instantsearch$': '<rootDir>/packages/react-instantsearch/src/',
'^react-instantsearch-(.*[^v6])$':
'<rootDir>/packages/react-instantsearch-$1/src/',
'^instantsearch.js$': '<rootDir>/packages/instantsearch.js/src/',
},
modulePathIgnorePatterns: [
'<rootDir>/packages/create-instantsearch-app/src/templates',
],
globals: {
__DEV__: true,
'ts-jest': {},
},
snapshotFormat: {
printBasicPrototype: false,
},
// reporter for circleci
reporters: [
'default',
[
'jest-junit',
{
outputDirectory: 'junit/jest',
suiteNameTemplate: '{filepath}',
ancestorSeparator: ' › ',
addFileAttribute: 'true',
},
],
],
};
module.exports = config;