@istanbuljs/esm-loader-hook
Loader hook for ESM instrumentation (experimental!!)
Last updated 5 months ago by coreyfarrell .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @istanbuljs/esm-loader-hook 
SYNC missed versions from official npm registry.

@istanbuljs/esm-loader-hook

Tests NPM Version NPM Downloads ISC

This loader hook makes it relatively easy to use NYC to check coverage of ESM running in node.js 13.7.0. Note this makes use of experimental node.js features and thus may stop working upon release of new versions of node.js. Until the node.js feature is stabilized breakage should not be unexpected.

For more stable options to test coverage you can:

  • Use c8
  • Pre-instrument your code (run nyc instrument then test the output)

Adding to processes

To install this hook into a process the module must be provided through the --experimental-loader flag.

The following can be used for your npm test script to enable live instrumentation of ES modules being tested with mocha:

cross-env 'NODE_OPTIONS=--experimental-loader @istanbuljs/esm-loader-hook' nyc mocha

Configuration

This module executes babel-plugin-istanbul in a transformSource loader hook. No options are provided to the babel plugin and babel configuration files are not honored. Normally configuration will be provided by the currently running instance of nyc. If this module is run outside nyc then it will use @istanbuljs/load-nyc-config to load options, defaults from @istanbuljs/schema will apply to missing options or if no configuration is found.

Current Tags

  • 0.1.2                                ...           latest (5 months ago)

3 Versions

  • 0.1.2                                ...           5 months ago
  • 0.1.1                                ...           5 months ago
  • 0.1.0                                ...           7 months ago
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dev Dependencies (6)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |