9.2.0 • Published 4 months ago

v8-to-istanbul v9.2.0

Weekly downloads
7,477,577
License
ISC
Repository
github
Last release
4 months ago

v8-to-istanbul

Build Status Conventional Commits nycrc config on GitHub

converts from v8 coverage format to istanbul's coverage format.

Usage

const v8toIstanbul = require('v8-to-istanbul')
// the path to the original source-file is required, as its contents are
// used during the conversion algorithm.
const converter = v8toIstanbul('./path-to-instrumented-file.js')
await converter.load() // this is required due to async file reading.
// provide an array of coverage information in v8 format.
converter.applyCoverage([
  {
    "functionName": "",
    "ranges": [
      {
        "startOffset": 0,
        "endOffset": 520,
        "count": 1
      }
    ],
    "isBlockCoverage": true
  },
  // ...
])
// output coverage information in a form that can
// be consumed by Istanbul.
console.info(JSON.stringify(converter.toIstanbul()))

Ignoring Uncovered Lines

Sometimes you might find yourself wanting to ignore uncovered lines in your application (for example, perhaps you run your tests in Linux, but there's code that only executes on Windows).

To ignore lines, use the special comment /* v8 ignore next */.

NOTE: Before version 9.2.0 the ignore hint had to contain c8 keyword, e.g. /* c8 ignore ....

ignoring the next line

const myVariable = 99
/* v8 ignore next */
if (process.platform === 'win32') console.info('hello world')

ignoring the next N lines

const myVariable = 99
/* v8 ignore next 3 */
if (process.platform === 'win32') {
  console.info('hello world')
}

ignoring all lines until told

/* v8 ignore start */
function dontMindMe() {
  // ...
}
/* v8 ignore stop */

ignoring the same line as the comment

const myVariable = 99
const os = process.platform === 'darwin' ? 'OSXy' /* v8 ignore next */ : 'Windowsy' 

Testing

To execute tests, simply run:

npm test
@jest/reporterseasy-select-rnreact-native-bluetooth2specify-importsbabel-specify-importsreact-native-template-rfbaseairscanairscan-examplereact-native-esc-pos-sahaab@borisovart/atol-kkt-moduledeneme323112@ntt_app/react-native-custom-notificationreact-native-covid-sdkgql_din_modbitget@olivervorasai/sliderreact-native-printer-brothersreact-native-shekhar-bridge-testwilscanner@oiti/documentoscopy-react-native@mink-opn/build-tokensquoc-test@infinitebrahmanuniverse/nolb-v8@saaspe/componentsplginexpand-react-bridgemost-dependenciesluminos-ui-coresklif-ui-kitsklif-api@everything-registry/sub-chunk-3039jawwy-sdkjawwy_gamification_release@314oner_npm/universal-components-libraryreact-native-sphereuisphereuijawwy_libraryreact-native-credit-card-pkgp149-tablesklif-uireact-native-jawwy_sample@alxrg/date-maker@angangii/frontendpractice@amirdiafi/react-native-ios-haptics@arielapaula/components@arielapaula/test@aristidenf/streak-counter@asiz33/smartblok-vendure-plugin@ali5049/react-native-buttons@alexdelgado/typewriter@azalpacir/react-native-dhp-printer@aysea/react-native-ui-librarycaymland-trackingcineverse-apiclient-javascript@con-test/react-native-concent-common@batbayar/superset-plugin-chart-hello-worldbog005-md-links@behzadebrhm/utils@cs6/react-native-test-native-view-library@damruravihara/react-native-testing-packagecommon-myappointment@cute-apocalypse/react-treecolor-scheme-detector@deep27/supersetpluginchart-helloworldconway-game@blazinaj/app-kitbrowser-esm-coverage@bezael-challenge/innoit-date-format@bhzdbash/utils@bgotink/playwright-coverageboximageshadows@born3am/eslint-configc8@bryntum/siesta@blusalt-sdk/react-native-blusalt-document-verification@blueberry_muffins/email_library@baolong281/gsplat@badpingpong/placeholderimagebmi-countcandlelabssdk@brantalikp/rn-resizecash-registercapycalendar@catalinaquinteror/mdlinkscbfl@simstudio/htmldiffjawwy_library_newjawy_library_v1gamification-jawwy-libraryframework_test_library_sixdee_new_jawwyzzzxxxyyy321123puppeteer-to-istanbulpuppeteer-to-istanbul-extraqaapio-reecord-mp3pyreswap-sdkraact-native-arunramya151polyglot-component-libraryreact-credoreac-native-arun-ramya-testreact-native-app-bubble
9.2.0

4 months ago

9.1.1

6 months ago

9.1.3

6 months ago

9.1.2

6 months ago

9.1.0

1 year ago

9.0.1

2 years ago

9.0.0

2 years ago

8.1.1

2 years ago

8.1.0

3 years ago

8.0.0

3 years ago

7.1.2

3 years ago

7.1.1

3 years ago

7.1.0

3 years ago

7.0.0

3 years ago

6.0.1

3 years ago

6.0.0

3 years ago

5.0.1

4 years ago

5.0.0

4 years ago

4.1.4

4 years ago

4.1.3

4 years ago

4.1.2

4 years ago

4.1.1

4 years ago

4.1.0

4 years ago

4.0.1

4 years ago

4.0.0

4 years ago

3.2.6

4 years ago

3.2.5

4 years ago

3.2.4

4 years ago

3.2.3

5 years ago

3.2.2

5 years ago

3.2.1

5 years ago

3.2.0

5 years ago

3.1.3

5 years ago

3.1.2

5 years ago

3.1.1

5 years ago

3.1.0

5 years ago

3.0.1

5 years ago

3.0.0

5 years ago

2.1.0

5 years ago

2.0.5

5 years ago

2.0.4

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago