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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: branches coverage isn't correct with 7.18.13 #14899

Closed
1 task
CSchulz opened this issue Sep 1, 2022 · 7 comments
Closed
1 task

[Bug]: branches coverage isn't correct with 7.18.13 #14899

CSchulz opened this issue Sep 1, 2022 · 7 comments
Labels
i: bug Needs Info outdated A closed issue/PR that is archived due to age. Recommended to make a new issue

Comments

@CSchulz
Copy link

CSchulz commented Sep 1, 2022

馃捇

  • Would you like to work on a fix?

How are you using Babel?

Programmatic API (babel.transform, babel.parse)

Input code

Using following typescript code with jest-preset-angular@12 and angular@13:

@Pipe({
  name: 'config',
})
export class ConfigPipe implements PipeTransform {
  constructor(private service: ConfigService) {
    console.log('');
  }

  public transform<K extends keyof Config>(key: K): Config[K] {
    return this.service.get(key);
  }
}

Configuration file name

No response

Configuration

No response

Current and expected behavior

Branches are covered with 7.18.10 for 100 % and 7.18.13 for 75 %.

I have tracked it down to the change between @babel/core@7.18.10 and @babel/core@7.18.13.
Here is the direct diff between the instrumented code fragments:
https://www.diffchecker.com/2omuXETX

Environment

babel/core 7.18.13
System:
OS: Windows 10 10.0.19043
Binaries:
Node: 16.14.2 - C:\nodejs\node.EXE
npm: 8.5.0 - C:\nodejs\npm.CMD
Monorepos:
Lerna: 5.1.8
npmPackages:
eslint: ~8.2.0 => 8.2.0
jest: ~28.1.0 => 28.1.3
lerna: ~5.1.3 => 5.1.8

Possible solution

No response

Additional context

No response

@babel-bot
Copy link
Collaborator

Hey @CSchulz! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite.

@liuxingbaoyu
Copy link
Member

Can you provide a repo that reproduces it?

@CSchulz CSchulz changed the title [Bug]: branches coverage isn't correct with 7.8.13 [Bug]: branches coverage isn't correct with 7.18.13 Sep 2, 2022
@babel-bot
Copy link
Collaborator

Hi @CSchulz! This issue is missing some important information we'll need to be able to reproduce this issue.

Please understand that we receive a high volume of issues, and there are only a limited number of volunteers that help maintain this project. The easier it is for us to decipher an issue with the info provided, the more likely it is that we'll be able to help.

Please make sure you have the following information documented in this ticket:

  1. Your Babel configuration (typically from .babelrc or babel.config.js)
  2. The current (incorrect) behavior you're seeing
  3. The behavior you expect
  4. A short, self-contained example

Please provide either a link to the problem via the repl, or if the repl is insufficient, a new and minimal repository with instructions on how to build/replicate the issue.

@CSchulz
Copy link
Author

CSchulz commented Sep 5, 2022

I am trying to set it up, but it is not easy because I can't produce it in a tiny project.

@liuxingbaoyu
Copy link
Member

Ok, if the project is not private, a not-minimal reproduction might also help.

@nicole-ashley
Copy link

nicole-ashley commented Jan 18, 2023

I know it's not that helpful, but this is affecting our project too via an upgrade from Angular 15.0.4 to 15.1.0 (which upgraded @babel/core). I'd expect this issue to get a lot more attention soon as people upgrade Angular and are affected (unless it's a really niche compatibility issue).

It's a large, private project so not helpful for repro. But the upgrade lowers both the total number of branches and the coverage of those branches (coverage lowers more than total so the ratio ends up lower, which is how I noticed the issue).

@nicolo-ribaudo
Copy link
Member

Closing as no repository to reproduce the issue has been provided.

@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 5, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
i: bug Needs Info outdated A closed issue/PR that is archived due to age. Recommended to make a new issue
Projects
None yet
Development

No branches or pull requests

5 participants