Open bigirishlion opened 2 years ago
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?
because when I remove the package, all the tests work properly
Hi, @bigirishlion! Plz show how you load the asm package when running the tests
because when I remove the package, all the tests work properly
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 cardano_serialization_lib
I get this error:
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?