'Intanbul branch coverage report in angular is wrong

This code should actually be 100% covered. But for some reason I get 80% Branches 4/5:

@NgModule({
  declarations: [
    PasswordPromptComponent,
  ],
  imports: [
    CommonModule,
    BrowserAnimationsModule,

    LoginModule,
    LoginModuleFeatureSharedModule,
    PasswordFormModule,
  ],
  providers: [
    { provide: DIALOG_SERVICE_TOKEN, useClass: DialogService, },
    { provide: DYNAMIC_DIALOG_REF_TOKEN, useClass: DynamicDialogRef, },
    { provide: HTTP_INTERCEPTORS, useClass: AuthInterceptor, multi: true },
  ],
  exports: [
    PasswordPromptComponent,
  ]
})
export class PasswordPromptModule { }

The coverage report looks then like this: enter image description here

What am I doing wrong?

I'm using @jsdevtools/coverage-istanbul-loader like this:

const path = require('path');

module.exports = {
  module: {
    rules: [
      {
        test: /\.(js|ts|html)$/,
        loader: '@jsdevtools/coverage-istanbul-loader',
        options: { esModules: true },
        enforce: 'post',
        exclude: [
          /\.(e2e|spec)\.ts$/,
          /node_modules/,
          /(ngfactory|ngstyle)\.js/,
        ],
      },
    ],
  },
};


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source