Closed bennycode closed 8 months ago
Today I learnt that c8 supports .nycrc.json config files, so I could easily switch to c8
and make it working with TypeScript, ESM & Jasmine:
{
"scripts": {
"test": "c8 --config=.nycrc.json ts-node-esm ./node_modules/.bin/jasmine --config=jasmine.json"
}
}
Hi there, I moved my TypeScript codebase from CommonJS to ESM (using
"type": "module"
in mypackage.json
file). Mynyc.config.json
looks like this:According to the docs of
ts-node
, I have to switch from--require ts-node/register
to--loader ts-node/esm
.I tried to change
"require": ["ts-node/esm"]
to"loader": ["ts-node/esm"]
in mynyc.config.json
but I am getting this error:Can you help me with a code recipe to solve that? Currently I am starting my tests with Jasmine without nyc:
ts-node-esm ./node_modules/.bin/jasmine --config=jasmine.json
.Best, Benny