I use yarn in my React Native project. I would like to add a fork of jest-enzyme package to my dependencies (the fork adds Flow type definitions).
The problem is that the package I need is not in the root of repository but in packages/jest-enzyme
subdirectory.
Running yarn add --dev https://github.com/lifeiscontent/enzyme-matchers.git
installs the whole enzyme-assertions
package.
If I try to import it as import 'enzyme-assertions/jest-enzyme';
, I get "Cannot find module" error. import 'jest-enzyme';
does not work either (same error).
I also tried running yarn add --dev https://github.com/lifeiscontent/enzyme-matchers.git/packages/jest-enzyme
, but this is not supported (I am getting 404 error). #
is for branches, commits and tags, so I don't think it will work.
So how do I install this package?
Have you tried to directly reference the submodule path?
import jestEnzyme from 'enzyme-matchers/packages/jest-enzyme';
Note that the project is a multirepository managed by Lerna, so the sub-packages provide only the source code, which still needs to be builded/compiled in order to be used.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With