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.
Activity
robertvansteen commentedon Oct 14, 2019
This should be fixed in the next version.