diff --git a/babel.config.js b/babel.config.js index 63afeb3769..faf9b3e36b 100644 --- a/babel.config.js +++ b/babel.config.js @@ -47,6 +47,9 @@ module.exports = function (api) { production: { plugins: ['transform-remove-console'], }, + test: { + plugins: ['@babel/plugin-transform-class-static-block'], + }, }, } } diff --git a/package.json b/package.json index 8fb404d073..8f825274f3 100644 --- a/package.json +++ b/package.json @@ -318,8 +318,19 @@ "transform": { "\\.[jt]sx?$": "babel-jest" }, + "moduleNameMapper": { + "^multiformats$": "/node_modules/multiformats/dist/src/index.js", + "^multiformats/cid$": "/node_modules/multiformats/dist/src/cid.js", + "^multiformats/bases/base32$": "/node_modules/multiformats/dist/src/bases/base32.js", + "^multiformats/hashes/digest$": "/node_modules/multiformats/dist/src/hashes/digest.js", + "^multiformats/hashes/sha2$": "/node_modules/multiformats/dist/src/hashes/sha2.js", + "^uint8arrays/from-string$": "/node_modules/uint8arrays/dist/src/from-string.js", + "^uint8arrays/to-string$": "/node_modules/uint8arrays/dist/src/to-string.js", + "^unicode-segmenter/grapheme$": "/node_modules/unicode-segmenter/grapheme.cjs", + "^await-lock$": "/node_modules/await-lock/build/AwaitLock.js" + }, "transformIgnorePatterns": [ - "node_modules/(?!((jest-)?react-native|@react-native(-community)?)|@discord|expo(nent)?|@expo(nent)?/.*|@expo-google-fonts/.*|react-navigation|nanoid|@react-navigation/.*|@unimodules/.*|unimodules|sentry-expo|native-base|normalize-url|react-native-svg|@sentry/.*|sentry-expo|bcp-47-match|@atproto/.*|multiformats|uint8arrays|unicode-segmenter|@ipld/.*|cborg)" + "node_modules/(?!((jest-)?react-native|@react-native(-community)?)|@discord|expo(nent)?|@expo(nent)?/.*|@expo-google-fonts/.*|react-navigation|nanoid|@react-navigation/.*|@unimodules/.*|unimodules|sentry-expo|native-base|normalize-url|react-native-svg|@sentry/.*|sentry-expo|bcp-47-match|@atproto/.*|multiformats|uint8arrays|@ipld/.*|cborg|await-lock)" ], "modulePathIgnorePatterns": [ "__tests__/.*/__mocks__",