got
got copied to clipboard
Enable coverage again
Had to be disabled for ESM: https://github.com/sindresorhus/got/pull/1687/commits/1eee7c24a33251ae52bbcf841e94760cecd3e6f3
Blocked by https://github.com/istanbuljs/nyc/issues/1353 (I tried using the mentioned @istanbuljs/esm-loader-hook, but it didn't work)
c8 is a better and faster alternative to nyc and it works with esm https://www.npmjs.com/package/c8
@sayem314 it's not better because it's not reliable. It gives false line numbers.
@szmarczak I see. For me, it works fine hence recommended.
@sayem314 Thanks for the suggestion :)
@sindresorhus it looks like got/package.json tells ava to use --loader=ts-node/esm. Unfortunately node.js does not support chaining multiple --loader options.
Relevant: nodejs/modules#513 āUsing multiple loadersā.
I think this could be done with a single loader, as long as itās Babel instead of ts-node: use --loader babel-register-esm with a babel.config.json like this.
{
"presets": ["@babel/typescript"],
"env": {
"test": {
"plugins": ["babel-plugin-istanbul"]
}
}
}