-
Notifications
You must be signed in to change notification settings - Fork 681
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: fix config-overrides to work with jest
- Loading branch information
1 parent
ca17f11
commit 12b2e02
Showing
5 changed files
with
38 additions
and
116 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,39 @@ | ||
const { override, babelInclude } = require('customize-cra') | ||
const path = require('path') | ||
|
||
const overridedConfig = override( | ||
babelInclude([ | ||
path.resolve(__dirname, 'src'), | ||
path.resolve(__dirname, 'node_modules/react-virtualized-auto-sizer'), | ||
path.resolve( | ||
__dirname, | ||
'node_modules/decentraland-connect/node_modules/@walletconnect' | ||
), | ||
path.resolve('node_modules/@metamask/utils/node_modules/superstruct'), | ||
path.resolve(__dirname, 'node_modules/@walletconnect'), | ||
path.resolve(__dirname, 'node_modules/@dcl/single-sign-on-client'), | ||
path.resolve(__dirname, 'node_modules/@0xsquid/sdk'), | ||
path.resolve(__dirname, 'node_modules/@cosmjs'), | ||
path.resolve(__dirname, 'node_modules/cosmjs-types'), | ||
path.resolve(__dirname, 'node_modules/ethers-multicall-provide'), | ||
path.resolve(__dirname, 'node_modules/@noble') | ||
]) | ||
) | ||
|
||
const jestConfig = config => { | ||
config.transformIgnorePatterns = [ | ||
'node_modules/?!@0xsquid|eccrypto|libsodium-wrappers-sumo' | ||
] | ||
config.moduleNameMapper = { | ||
'@dcl/single-sign-on-client': 'identity-obj-proxy', | ||
'^react-native$': 'react-native-web', | ||
'^.+\\.module\\.(css|sass|scss)$': 'identity-obj-proxy' | ||
} | ||
console.log('config: ', config) | ||
return config | ||
} | ||
|
||
module.exports = { | ||
jest: config => { | ||
config.transformIgnorePatterns = [ | ||
'node_modules/?!@0xsquid|eccrypto|libsodium-wrappers-sumo' | ||
] | ||
config.moduleNameMapper = { | ||
'@dcl/single-sign-on-client': 'identity-obj-proxy' | ||
} | ||
return config | ||
}, | ||
...override( | ||
babelInclude([ | ||
path.resolve(__dirname, 'src'), | ||
path.resolve(__dirname, 'node_modules/react-virtualized-auto-sizer'), | ||
path.resolve( | ||
__dirname, | ||
'node_modules/decentraland-connect/node_modules/@walletconnect' | ||
), | ||
path.resolve('node_modules/@metamask/utils/node_modules/superstruct'), | ||
path.resolve(__dirname, 'node_modules/@walletconnect'), | ||
path.resolve(__dirname, 'node_modules/@dcl/single-sign-on-client'), | ||
path.resolve(__dirname, 'node_modules/@0xsquid/sdk'), | ||
path.resolve(__dirname, 'node_modules/@cosmjs'), | ||
path.resolve(__dirname, 'node_modules/cosmjs-types'), | ||
path.resolve(__dirname, 'node_modules/ethers-multicall-provide'), | ||
path.resolve(__dirname, 'node_modules/@noble') | ||
]) | ||
) | ||
...overridedConfig, | ||
jest: jestConfig | ||
} |
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
74 changes: 0 additions & 74 deletions
74
webapp/src/components/Modals/BuyWithCryptoModal/BuyWithCryptoModal.spec.tsx
This file was deleted.
Oops, something went wrong.