Skip to content

Commit

Permalink
Fix yarn run v1.22.4
Browse files Browse the repository at this point in the history
$ jest App
Done in 5.66s. shootismoke#724
  • Loading branch information
bertoort committed Oct 3, 2020
1 parent 2d7fb34 commit 7e50d98
Show file tree
Hide file tree
Showing 6 changed files with 860 additions and 684 deletions.
2 changes: 1 addition & 1 deletion App/stores/api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('withTimeout', () => {
it('should correct time out', async (done) => {
jest.setTimeout(5000);

const p = new Promise((resolve) => setTimeout(resolve, 2000));
const p = new Promise((resolve) => setTimeout(resolve, 2001));

try {
await withTimeout(p, 2000);
Expand Down
3 changes: 3 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
};
17 changes: 16 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
const { defaults: tsjPreset } = require('ts-jest/presets');

module.exports = {
...tsjPreset,
preset: 'jest-expo',
moduleFileExtensions: ['js', 'ts', 'tsx'],
testMatch: ['**/?(*.)+(spec|test).ts?(x)'],
moduleNameMapper: {
'\\.(jpg|ico|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/mocks/fileMock.js',
},
transform: {
'^.+\\.tsx?$': 'ts-jest',
...tsjPreset.transform,
},
transformIgnorePatterns: [
'node_modules/(?!(jest-)?react-native|react-clone-referenced-element|@react-native-community|expo(nent)?|@expo(nent)?/.*|react-navigation|@react-navigation/.*|@unimodules/.*|unimodules|sentry-expo|native-base|@sentry/.*)',
],
globals: {
'ts-jest': {
babelConfig: true,
},
},
};
1 change: 1 addition & 0 deletions mocks/fileMock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = '';
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@
"@types/jest": "^26.0.14",
"detox": "^17.8.0",
"detox-expo-helpers": "^0.6.0",
"jest": "^24.9.0",
"jest": "^26.4.2",
"jest-expo": "^39.0.0",
"ts-jest": "^24.3.0",
"ts-jest": "^26.4.1",
"typescript": "~3.9.2"
}
}
Loading

0 comments on commit 7e50d98

Please sign in to comment.