From ca17f11e1e416a6e6fe87410dff40627c7eb9d5a Mon Sep 17 00:00:00 2001 From: Juanma Hidalgo Date: Wed, 15 Nov 2023 20:49:01 +0100 Subject: [PATCH] chore: add jest config to transpile squid lib --- webapp/config-overrides.js | 47 +++++++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/webapp/config-overrides.js b/webapp/config-overrides.js index abae9cddb3..ddb0624b25 100644 --- a/webapp/config-overrides.js +++ b/webapp/config-overrides.js @@ -1,21 +1,32 @@ const { override, babelInclude } = require('customize-cra') const path = require('path') -module.exports = 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') - ]) -) +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') + ]) + ) +}