-
-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fix yarn test:unit v1.22.4 (#753)
* Fix yarn run v1.22.4 $ jest App Done in 5.66s. #724 * ci: run unit tests in github pr workflow * Update babel.config.js * Update jest.config.js * Update jest.config.js * Update jest.config.js * Update jest.config.js Co-authored-by: Amaury Martiny <amaury.martiny@protonmail.com>
- Loading branch information
1 parent
3286566
commit 1b7e89e
Showing
7 changed files
with
873 additions
and
685 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = { | ||
// Properly configure ts-jest. | ||
// https://kulshekhar.github.io/ts-jest/user/react-native/#babel-config | ||
presets: ['module:metro-react-native-babel-preset'], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,28 @@ | ||
/* eslint-disable */ | ||
const { defaults: tsjPreset } = require('ts-jest/presets'); | ||
|
||
module.exports = { | ||
...tsjPreset, | ||
preset: 'jest-expo', | ||
moduleFileExtensions: ['js', 'ts', 'tsx'], | ||
testMatch: ['**/?(*.)+(spec|test).ts?(x)'], | ||
// Mock static asset imports. | ||
// https://jestjs.io/docs/en/webpack#handling-static-assets | ||
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, | ||
}, | ||
// blacklist any unwanted modules that get transpiled, like sentry | ||
// https://docs.expo.io/guides/testing-with-jest/#jest-configuration | ||
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, // Globals with ts-jest config to look for babel config. | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = ''; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.