agracio/edge-js-quick-start

Error when running edge-js inside Jest test

RodionKulin opened this issue · 1 comments

I was able to launch edge-js-quick-start for NET Core sample project with command
npm run start:core

But I had to specify
process.env.CORECLR_VERSION = '5.0.17';
or
process.env.CORECLR_VERSION = '2.0.9';
to locate Microsoft.NETCore.App
Where '5.0.17' or '2.0.9' is existing directory in Windows 11 in:
C:\Program Files\dotnet\shared\Microsoft.NETCore.App\
to solve error
"CoreClrEmbedding::Initialize - Could not resolve CoreCLR path."
May be it will help to investigate the error bellow.

Then I tried to run same successful setup inside Jest test and it failed with error

Could not resolve CoreCLR path. For more details, enable tracing by setting COREHOST_TRACE environment
edge.initializeClrFunc is not a function

I created a fork to reproduce it
https://github.com/RodionKulin/edge-js-quick-start

Do you have any suggestions how to make edge-js work in Jest, so I can run some NET library inside my Jest tests?

Would be easier if that error message included CoreCLR path it is not able to resolve.