-
Notifications
You must be signed in to change notification settings - Fork 349
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: fix mobile jest tests with solana libs
- Loading branch information
Showing
2 changed files
with
28 additions
and
0 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,27 @@ | ||
module.exports = (path, options) => { | ||
// Call the defaultResolver, so we leverage its cache, error handling, etc. | ||
return options.defaultResolver(path, { | ||
...options, | ||
// Use packageFilter to process parsed `package.json` before the resolution (see https://www.npmjs.com/package/resolve#resolveid-opts-cb) | ||
packageFilter: pkg => { | ||
const pkgNamesToTarget = new Set([ | ||
"rpc-websockets", | ||
"@solana/codecs", | ||
"@solana/codecs-core", | ||
"@solana/errors", | ||
"@solana/codecs-data-structures", | ||
"@solana/codecs-numbers", | ||
"@solana/codecs-strings", | ||
"@solana/options", | ||
]); | ||
|
||
if (pkgNamesToTarget.has(pkg.name)) { | ||
// console.log('>>>', pkg.name) | ||
delete pkg["exports"]; | ||
delete pkg["module"]; | ||
} | ||
|
||
return pkg; | ||
}, | ||
}); | ||
}; |