-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when running Jest tests #453
Comments
This is unrelated to our library, plz google running jest with typescript |
@vsubhuman Thanks for the reply. I've definitely isolated it to the library because when I remove the package, all the tests work properly. I'm curious if you know of any projects out there that are using Jest to run tests against the asmjs version of the library? |
Hi, @bigirishlion! Plz show how you load the asm package when running the tests |
I've tried it multiple ways: Standard import: import * as serializationLib from '@emurgo/cardano-serialization-lib-asmjs/cardano_serialization_lib'; I've also tried dynamically loading the package via: export const loadCardanoWasm = async () => {
if (cardanoWasm) {
return cardanoWasm;
}
cardanoWasm = await import('@emurgo/cardano-serialization-lib-asmjs/cardano_serialization_lib');
return cardanoWasm;
}; Also, if I try without import * as serializationLib from '@emurgo/cardano-serialization-lib-asmjs';
Cannot find module '@emurgo/cardano-serialization-lib-asmjs' from 'src/index.ts' |
I'm currently working on a project that uses Typescript and Jest to test out my library. When I run tests, I'm getting this error:
Here is my tsconfig.js
And jest.config.js
Any idea how to fix this error?
The text was updated successfully, but these errors were encountered: