-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathjest.config.js
37 lines (32 loc) · 1.19 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
/* eslint-disable jest/no-commented-out-tests */
/*
Currently, we need a patch, preventing Jest from crashing tests when rejected Promise is not handled.
It is applied in `postinstall.sh` script.
### Example:
```ts
it('should succeed, but crashes', async () => {
Promise.reject(); // Normally such code does not crash entire runtime
await new Promise(r => setImmediate(r));
expect('42').toEqual('42');
})
```
See:
- https://github.com/jestjs/jest/issues/11165
- https://github.com/nodejs/node/issues/20392
- https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode
*/
process.env.TZ = 'UTC';
process.env.LANG = 'en_GB.UTF-8';
module.exports = {
preset: 'react-native',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
transformIgnorePatterns: [
'node_modules/(?!((jest-)?@react-native|react-native|react-native-themis|react-navigation|@react-navigation/.*|rxjs|lodash-es|@sentry/.*))'
],
setupFiles: ['<rootDir>/jest.setup.js', 'jest-date-mock'],
moduleNameMapper: {
'^src/(.*)': '<rootDir>/src/$1',
'\\.svg': '<rootDir>/src/mocks/svg.mock.js',
'^react-native-themis': '<rootDir>/node_modules/react-native-themis/src/index.js'
}
};