Skip to content
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

Enable coverage again #1688

Open
sindresorhus opened this issue Apr 15, 2021 · 7 comments
Open

Enable coverage again #1688

sindresorhus opened this issue Apr 15, 2021 · 7 comments
Labels
external The issue related to an external project

Comments

@sindresorhus
Copy link
Owner

Had to be disabled for ESM: 1eee7c2

Blocked by istanbuljs/nyc#1353 (I tried using the mentioned @istanbuljs/esm-loader-hook, but it didn't work)

@szmarczak szmarczak added the external The issue related to an external project label Apr 15, 2021
@sayem314
Copy link

c8 is a better and faster alternative to nyc and it works with esm
https://www.npmjs.com/package/c8

@szmarczak
Copy link
Collaborator

@sayem314 it's not better because it's not reliable. It gives false line numbers.

@sayem314
Copy link

@szmarczak I see. For me, it works fine hence recommended.

@szmarczak
Copy link
Collaborator

@sayem314 Thanks for the suggestion :)

@coreyfarrell
Copy link

@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.

@andersk
Copy link

andersk commented Aug 27, 2021

Relevant: nodejs/modules#513 “Using multiple loaders”.

@andersk
Copy link

andersk commented Aug 28, 2021

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"]
    }
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external The issue related to an external project
Projects
None yet
Development

No branches or pull requests

5 participants