Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ExportDeclarations not scanned for ignores #30

Open
TimothyGu opened this issue Nov 23, 2016 · 3 comments
Open

ExportDeclarations not scanned for ignores #30

TimothyGu opened this issue Nov 23, 2016 · 3 comments

Comments

@TimothyGu
Copy link

/* istanbul ignore next */
export function doesntWork() {
  if (true) {
    console.log('covered');
  } else {
    console.log('not covered');
  }
}

/* istanbul ignore next */
function works() {
  if (true) {
    console.log('covered');
  } else {
    console.log('not covered');
  }
}
export { works };

After transforming it with Babel:

// ...

/* istanbul ignore next */
export function doesntWork() {
  ++cov_vic9ro8ua.f[0];
  ++cov_vic9ro8ua.s[0];

  if (true) {
    ++cov_vic9ro8ua.b[0][0];
    ++cov_vic9ro8ua.s[1];

    console.log('covered');
  } else {
    ++cov_vic9ro8ua.b[0][1];
    ++cov_vic9ro8ua.s[2];

    console.log('not covered');
  }
}

/* istanbul ignore next */
function works() {
  if (true) {
    console.log('covered');
  } else {
    console.log('not covered');
  }
}
export { works };

The ignore annotation is not respected.

It looks possible that the codeVisitor list needs to be updated.

TimothyGu added a commit to node-fetch/node-fetch that referenced this issue Nov 23, 2016
@bcoe
Copy link
Contributor

bcoe commented Nov 27, 2016

@TimothyGu annoying! if you have a moment, would love a failing test case to work from.

thanks for reporting this issue.

@TimothyGu
Copy link
Author

@bcoe, the example I gave in the issue description can serve as a failing test case. Is there anything more than that you need?

@bcoe
Copy link
Contributor

bcoe commented Mar 22, 2017

@TimothyGu coule I bother you to reopen this issue on the istanbuljs monorepo:

https://github.com/istanbuljs/istanbuljs

Assuming that you're still bumping into it 👍

fatboy0112 added a commit to fatboy0112/node-fetch that referenced this issue Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants