You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I created a Typescript-enabled React app bootstrapped from create-react-app. After enabling baseUrl: "." for easier absolute imports, my Jest tests broke.
How to repro:
With a src folder in your root directory, add baseUrl: "." to your tsconfig.json under compilerOptions.
Create a Jest test file with the following code:
import{isValidAddress}from'orbit-db';it('doesnt fail to resolve import',()=>{isValidAddress("asdf");});
Run npm install orbit-db ipfs and then npm run test. You should end up with something similar to the following error:
According to my understand of CRA, the moduleNameMapper regex is generated when the CRA script sees the baseUrl field in tsconfig.json. However, this regex also seems to wrongly capture some of the imports in files from node_modules.
The text was updated successfully, but these errors were encountered:
I created a Typescript-enabled React app bootstrapped from create-react-app. After enabling
baseUrl: "."
for easier absolute imports, my Jest tests broke.How to repro:
baseUrl: "."
to your tsconfig.json undercompilerOptions
.npm install orbit-db ipfs
and thennpm run test
. You should end up with something similar to the following error:According to my understand of CRA, the
moduleNameMapper
regex is generated when the CRA script sees thebaseUrl
field intsconfig.json
. However, this regex also seems to wrongly capture some of the imports in files fromnode_modules
.The text was updated successfully, but these errors were encountered: