vinothpandian/react-sketch-canvas

coverage data in dist folder files of npm package interfering with jest coverage

paradite opened this issue · 4 comments

Describe the bug
Coverage data are found in various files in dist folder of the npm package, causing increased file size and more importantly interfering with jest coverage data (running jest with coverage reports extra info from this pacakge).

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://unpkg.com/react-sketch-canvas@6.1.0/dist/react-sketch-canvas.cjs.development.js and check the file content
  2. Go to https://unpkg.com/react-sketch-canvas@6.1.0/dist/react-sketch-canvas.esm.js and check the file content
  3. Go to https://unpkg.com/react-sketch-canvas@6.1.0/dist/react-sketch-canvas.cjs.production.min.js and check the file content

Observe the following:

function cov_20wqqco38b() {
  var path = "/home/vinoth/projects/react-sketch-canvas/src/Paths/index.tsx";
  var hash = "80c4a162af9ff11419db7b7c460ec352bdae34fe";
  var global = new Function("return this")();
  var gcv = "__coverage__";
  var coverageData = {
    path: "/home/vinoth/projects/react-sketch-canvas/src/Paths/index.tsx",
    statementMap: {
      "0": {
        start: {
          line: 5,
          column: 23
        },
        end: {
          line: 13,
          column: 1
        }
      },
      "1": {
        start: {
          line: 6,
          column: 4
        },
        end: {
          line: 10,
          column: 5
        }
      },
      "2": {
        start: {
          line: 7,
          column: 25
        },
        end: {
          line: 7,
          column: 33
...

Expected behavior
no coverage data inside

Screenshots
file content:
Screenshot 2022-02-04 at 10 08 28 PM

production min file:
Screenshot 2022-02-04 at 10 16 06 PM

interference with jest:
Screenshot 2022-02-04 at 10 11 13 PM

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context

Fixed in 6.1.5

Looks like this issue was reintroduced in the pre-release version 7.0.0-next.2

Thanks for notifying me. I'll create an issue

Fixed it in 7.0.0-next.3