🎩 Coverage for EcmaScript Modules

Overview

🎩 ESCover License NPM version Build Status Coverage Status

Coverage for EcmaScript Modules based on 🐊 Putout and loaders.

Why another coverage tool?

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.

πŸ€·β€ What test runner does no transpiling to CommonJS?

☝️ that's easy! πŸ“Ό Supertape supports ESM from the box;

πŸ€·β€ How to mock modules without mock-require (we in ESM!);

☝️ that's solved! mock-import does the thing using loaders;

πŸ€·β€ How to get coverage when nyc doesn't supported?

☝️ c8 could help, but no it supports no query paramters which are needed to load module again, and apply mocks.

πŸ€·β€ How to get coverage when mocks are used?

☝️ Use ?? ESCover! It supports loaders, ESM and collects coverage as a loader!

Install

npm i escover -D

Run to collect and show coverage:

escover npm test

How it looks like?

When everything is covered:

image

When some lines missing coverage:

image

What if I want to use 🎩 ESCover with mock-import?

Experimental loaders supports only one, for now. So zenload should be used.

Install it with:

npm i escover mock-import zenload

Then run:

NODE_OPTIONS="'--loader zenlend'" ZENLOAD='escover,mock-import' escover npm test

This configuration will add coverage collectors and then apply mocks with help of mock-import. Of course the most comfortable way of doing this things will be madrun. Run you package-scripts in JavaScript :)!

License

MIT

You might also like...

A TailwindCSS variant for class-based dark mode with CSS Modules.

A TailwindCSS variant for class-based dark mode with Svelte's scoped stylesheets and CSS modules. If you've ever tried to use TailwindCSS dark mode wi

Dec 1, 2022

A UI library by WeChat official design team, includes the most useful widgets/modules in mobile web applications.

A UI library by WeChat official design team, includes the most useful widgets/modules in mobile web applications.

WeUI - tailor-made for WeChat web service δΈ­ζ–‡η‰ˆζœ¬ Introduction WeUI is an WeChat-like UI framework officially designed by the WeChat Design Team, tailor-

Jan 2, 2023

A set of small, responsive CSS modules that you can use in every web project.

A set of small, responsive CSS modules that you can use in every web project.

Pure A set of small, responsive CSS modules that you can use in every web project. https://purecss.io/ This project is looking for maintainers to supp

Jan 9, 2023

Automated packaging of Debian-flavored NGINX with PageSpeed modules. Written in Bash and GitHub Workers. APT Repository hosted on Dokku.

NGINX + Google PageSpeed Configuring NGINX to build correctly is a pain. Not because of anything wrong with it, but rather because of how slim the sta

Oct 14, 2022

This is my to-do list website built with html, css and JavaScript. In this project I used Webpack to bundle JavaScript and ES6 modules to write modular JavaScript.

This is my to-do list website built with html, css and JavaScript. In this project I used Webpack to bundle JavaScript and ES6 modules to write modular JavaScript.

To-Do-List App This is my to-do list website built with html, css and JavaScript. In this project I used Webpack to bundle JavaScript and ES6 modules

Sep 20, 2022

JavaScript project for the Leader-board list app, using webpack and ES6 features, notably modules

JavaScript project for the Leader-board list app, using webpack and ES6 features, notably modules

Leaderboard JavaScript project for the Leader-board list app, using webpack and ES6 features, Built With HTML CSS Javascript webpack Getting started t

Feb 17, 2022

A JavaScript project for the Leaderboard list app, using webpack and ES6 features, notably modules

A JavaScript project for the Leaderboard list app, using webpack and ES6 features, notably modules

LEADERBOARD In this activity I am setting up a JavaScript project for the Leaderboard list app, using webpack and ES6 features, notably modules. I wil

Mar 16, 2022

This is a simple To-do list built with JavaScript, HTML and CSS. The project uses webpack to bundle JS-modules. Users can add and remove task from the list

This is a simple To-do list built with JavaScript, HTML and CSS. The project uses webpack to bundle JS-modules. Users can add and remove task from the list

This is a simple To-do list built with JavaScript, HTML and CSS. The project uses webpack to bundle JS-modules. Users can add and remove task from the list

Jun 7, 2022

Using ES6 Modules on creating favorite books where we can save our favorit books

Using ES6 Modules on creating favorite books where we can save our favorit books

Dec 1, 2022
Releases(v2.5.1)
Owner
coderaiser
coderaiser
Hemsida fΓΆr personer i Sverige som kan och vill erbjuda boende till mΓ€nniskor pΓ₯ flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo fΓΆr kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
GitHub Action that posts the report in a comment on a GitHub Pull Request from coverage data generated by nyc (istanbul)

GitHub Action: Report NYC coverage GitHub Action that posts the report in a comment on a GitHub Pull Request from coverage data generated by nyc (ista

Sid 16 Nov 23, 2022
πŸ‘‹ Canyon is a JavaScript code coverage platform

Canyon Welcome to the Canyon codebase, we are thrilled to have you here! What is Canyon? Canyon is a JavaScript code coverage platform. Canyon can rea

Canyon 99 Oct 6, 2022
Coverage-guided, in-process fuzzing for the Node.js

Jazzer.js Jazzer.js is a coverage-guided, in-process fuzzer for the Node.js platform developed by Code Intelligence. It is based on libFuzzer and brin

Code Intelligence 113 Dec 26, 2022
Curso de ECMAScript 6+ en Platzi

Curso de ECMAScript 6+ JavaScript es el lenguaje mΓ‘s utilizado para desarrollo de aplicaciones web, principalmente en el frontend. Cada aΓ±o, ECMA Inte

Edward Brito Diaz 3 Feb 12, 2022
ESLint plugin about ECMAScript syntactic features.

eslint-plugin-es-x ESLint plugin which disallows each ECMAScript syntax. Forked from eslint-plugin-es. As the original repository seems no longer main

Yosuke Ota 69 Dec 6, 2022
An npm package for demonstration purposes using TypeScript to build for both the ECMAScript Module format (i.e. ESM or ES Module) and CommonJS Module format. It can be used in Node.js and browser applications.

An npm package for demonstration purposes using TypeScript to build for both the ECMAScript Module format (i.e. ESM or ES Module) and CommonJS Module format. It can be used in Node.js and browser applications.

Snyk Labs 57 Dec 28, 2022
This project is based on the Awesome Books app repo, refactored with ES6 and organized with modules. The purpose of this project is to learn functionality organization using JavaScript modules.

Awesome Books with ES6 and modules A basic app project built with HTML, CSS and JS ES6 to keep track of awesome books. Built With HTML/CSS and JS best

Karla Delgado 10 Aug 27, 2022
Import ES Modules from the top StackOverflow answer to a question

StackOverflow Copilot Like GitHub Copilot, but worse! Imports the first codeblock of the first answer to a StackOverflow question as an ES Module Usag

Mary 28 Jan 18, 2022