
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
Coverage for EcmaScript Modules based on 🐊Putout and loaders.
When you want to use ESM in Node.js without transpiling to CommonJS (that's what jest, ava, tap does),
you have a couple problems to solve.
CommonJS?☝️ that's easy! 📼 Supertape supports ESM from the box;
ESM!);☝️ that's solved! mock-import does the thing using loaders;
nyc doesn't supported?☝️ c8 could help, but no it supports no query parameters
which are needed to load module again, and apply mocks.
☝️ Use 🎩ESCover! It supports loaders, ESM and collects coverage as a loader!
coveralls? Does lcov supported?☝️ Sure! coverage/lcov.info is main coverage file for 🎩ESCover.
npm i escover -D
Run to collect and show coverage:
escover npm test
c8Check out the real example from wisdom. There is next uncovered code:
import {jessy} from 'jessy';
export default (info) => typeof jessy('publishConfig.access', info) === 'undefined';
c8 shows three columns with 100% and one with 0%.
And here is what you will see with 🎩ESCover:
So if you need more accurate code with no bullshit green 100%, use 🎩ESCover 😉.
exclude section of configuration file .nyrc.json supported.
When everything is covered:

There is two types of formatters:
lines adds links to each line;files shows information in table;You can choose formatter with ESCOVER_FORMAT env variable.
ESCover with mock-import?mock-import is used by default in 🎩ESCover.
Install it with:
npm i escover
Then run:
escover npm test
This is the same as:
NODE_OPTIONS="'--loader zenlend'" ZENLOAD='escover,mock-import' escover npm test
If you want to disable coverage on status code without erroring, use ESCOVER_SUCCESS_EXIT_CODE:
import {SKIPED} from 'supertape/exit-codes';
const env = {
ESCOVER_SUCCESS_EXIT_CODE: SKIPED,
};
export default {
test: () => [env, `escover tape 'test/**/*.js' 'lib/**/*.spec.js'`],
};
lcov?Format used by 🎩ESCover located in coverage/lcov.info.
lcov was created in 2002, twenty years ago.PERL and has text based format.When you run your ESM application with:
escover npm test
You will receive something similar to:
SF:/Users/coderaiser/escover/lib/transform.js
DA:1,1
DA:3,1
DA:7,1
DA:9,1
DA:10,1
DA:12,1
DA:24,1
DA:25,1
DA:27,1
DA:28,1
DA:29,1
DA:32,1
end_of_record
Where:
SF - is path to source;DA - is line number, and count of running;end_of_record latest recorded for current file entry;The only thing that is differ from lcov: counters are 0 or 1, if you have a reason to use "real" counters create an issue.
It can be added in one line of code, but I see no reason why it can be useful 🤷♂️.
MIT
FAQs
Coverage for EcmaScript Modules
We found that escover demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.