Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. # v8-to-istanbul
  2. [![Build Status](https://travis-ci.org/istanbuljs/v8-to-istanbul.svg?branch=master)](https://travis-ci.org/istanbuljs/v8-to-istanbul)
  3. [![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
  4. ![nycrc config on GitHub](https://img.shields.io/nycrc/istanbuljs/v8-to-istanbul)
  5. converts from v8 coverage format to [istanbul's coverage format](https://github.com/gotwarlost/istanbul/blob/master/coverage.json.md).
  6. ## Usage
  7. ```js
  8. const v8toIstanbul = require('v8-to-istanbul')
  9. // the path to the original source-file is required, as its contents are
  10. // used during the conversion algorithm.
  11. const converter = v8toIstanbul('./path-to-instrumented-file.js')
  12. await converter.load() // this is required due to the async source-map dependency.
  13. // provide an array of coverage information in v8 format.
  14. converter.applyCoverage([
  15. {
  16. "functionName": "",
  17. "ranges": [
  18. {
  19. "startOffset": 0,
  20. "endOffset": 520,
  21. "count": 1
  22. }
  23. ],
  24. "isBlockCoverage": true
  25. },
  26. // ...
  27. ])
  28. // output coverage information in a form that can
  29. // be consumed by Istanbul.
  30. console.info(JSON.stringify(converter.toIstanbul()))
  31. // cleanup resources allocated in "load" (i.e. by the source-map dependency),
  32. // the converter may not be used anymore afterwards
  33. converter.destroy()
  34. ```
  35. ## Ignoring Uncovered Lines
  36. Sometimes you might find yourself wanting to ignore uncovered lines
  37. in your application (for example, perhaps you run your tests in Linux, but
  38. there's code that only executes on Windows).
  39. To ignore lines, use the special comment `/* c8 ignore next */`.
  40. ### ignoring the next line
  41. ```js
  42. const myVariable = 99
  43. /* c8 ignore next */
  44. if (process.platform === 'win32') console.info('hello world')
  45. ```
  46. ### ignoring the next N lines
  47. ```js
  48. const myVariable = 99
  49. /* c8 ignore next 3 */
  50. if (process.platform === 'win32') {
  51. console.info('hello world')
  52. }
  53. ```
  54. ### ignoring all lines until told
  55. ```js
  56. /* c8 ignore start */
  57. function dontMindMe() {
  58. // ...
  59. }
  60. /* c8 ignore stop */
  61. ```
  62. ### ignoring the same line as the comment
  63. ```js
  64. const myVariable = 99
  65. const os = process.platform === 'darwin' ? 'OSXy' /* c8 ignore next */ : 'Windowsy'
  66. ```
  67. ## Testing
  68. To execute tests, simply run:
  69. ```bash
  70. npm test
  71. ```