-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Wrap cozy-dataproxy-lib imports in a mockable file
For some reasons, the ReactNative API fails to resolve `cozy-dataproxy-lib/api` path so we must use `/dist` version instead On the opposite, Jest will fail to resolve the `/dist` version so we cannot mock cozy-dataproxy-lib To fix this, we wrap the imports in a local file so we can mock this local file in Jest
- Loading branch information
Showing
3 changed files
with
11 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// We cannot use `cozy-dataproxy-lib/api` here due to our bundler configuration | ||
// even if it is declared in the package.json file. Instead we should target the | ||
// 'dist' directory. | ||
// In the future we should find a way to homogenize bundlers configuration. | ||
export { SearchEngine } from 'cozy-dataproxy-lib/dist/api' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters