Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix yarn run v1.22.4 #753

Merged
merged 7 commits into from
Oct 4, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ jobs:
- uses: actions/checkout@v1
- run: yarn install
- run: yarn lint

test-unit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- run: yarn install
- run: yarn test:unit
test-e2e:
runs-on: macOS-latest
steps:
Expand Down
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'],
amaury1093 marked this conversation as resolved.
Show resolved Hide resolved
};
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');
amaury1093 marked this conversation as resolved.
Show resolved Hide resolved

module.exports = {
...tsjPreset,
preset: 'jest-expo',
moduleFileExtensions: ['js', 'ts', 'tsx'],
testMatch: ['**/?(*.)+(spec|test).ts?(x)'],
moduleNameMapper: {
amaury1093 marked this conversation as resolved.
Show resolved Hide resolved
'\\.(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: [
amaury1093 marked this conversation as resolved.
Show resolved Hide resolved
'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,
amaury1093 marked this conversation as resolved.
Show resolved Hide resolved
},
},
};
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