Skip to content

Frameworks and CI services ​

Playwright ​

c8 ​

  • c8 has integrated MCR as an experimental feature since v10.1.0
sh
c8 --experimental-monocart --reporter=v8 --reporter=console-details node foo.js

CodeceptJS ​

VSCode ​

Jest ​

Vitest ​

Node Test Runner ​

Puppeteer ​

Cypress ​

WebdriverIO ​

Storybook Test Runner ​

TestCafe ​

Selenium Webdriver ​

Mocha ​

sh
mcr mocha ./test/**/*.js

TypeScript ​

sh
cross-env NODE_OPTIONS="--import tsx" npx mcr tsx ./src/example.ts
cross-env NODE_OPTIONS="--import tsx" npx mcr mocha ./test/**/*.ts
# MCR 3.x: Node.js >= 22.15.0
mcr --import tsx tsx ./src/example.ts
mcr --import tsx mocha ./test/**/*.ts
sh
cross-env NODE_OPTIONS="--loader ts-node/esm --no-warnings" npx mcr ts-node ./src/example.ts
cross-env NODE_OPTIONS="--loader ts-node/esm --no-warnings" npx mcr mocha ./test/**/*.ts

AVA ​

sh
mcr ava

Codecov ​

codecov

js
const coverageOptions = {
    outputDir: './coverage-reports',
    reports: [
        ['codecov']
    ]
};
  • Github actions:
yml
- name: Codecov
    uses: codecov/codecov-action@v4
    with:
        token: ${{ secrets.CODECOV_TOKEN }}
        files: ./coverage-reports/codecov.json

Codacy ​

Codacy

  • Using lcov report:
js
const coverageOptions = {
    outputDir: './coverage-reports',
    lcov: true
};
  • Github actions:
yml
- name: Codacy Coverage Reporter
    uses: codacy/codacy-coverage-reporter-action@v1
    with:
        project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
        coverage-reports: ./coverage-reports/lcov.info

Coveralls ​

Coverage Status

  • Using lcov report:
js
const coverageOptions = {
    outputDir: './coverage-reports',
    lcov: true
};
  • Github actions:
yml
- name: Coveralls
    uses: coverallsapp/github-action@v2
    with:
        files: ./coverage-reports/lcov.info

Sonar Cloud ​

Coverage

  • Using lcov report. Github actions example:
yml
- name: Analyze with SonarCloud
    uses: sonarsource/sonarcloud-github-action@master
    env:
        SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
    with:
        projectBaseDir: ./
        args: >
        -Dsonar.organization=cenfun
        -Dsonar.projectKey=monocart-coverage-reports
        -Dsonar.projectName=monocart-coverage-reports
        -Dsonar.javascript.lcov.reportPaths=coverage-reports/lcov.info
        -Dsonar.sources=lib
        -Dsonar.tests=test
        -Dsonar.exclusions=dist/*,packages/*