Skip to content

Tests with code coverage fail when using Angular 12.2.10 #21967

@hosuaby

Description

@hosuaby

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • extract-i18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

While running tests with code coverage ng test --code-coverage=true Karma fails with error.

Version 12.2.9 doesn't have this problem.

Description

🔬 Minimal Reproduction

ng test --code-coverage=true

🔥 Exception or Error

./src/app/timesheet/services/timesheet.service.ts - Error: Module build failed (from ./node_modules/@jsdevtools/coverage-istanbul-loader/lib/index.js):
Error: /home/hosuaby/projects/my-timesheet/src/app/timesheet/services/timesheet.service.ts: don't know how to turn this value into a node
    at valueToNode (/home/hosuaby/projects/my-timesheet/node_modules/@babel/types/lib/converters/valueToNode.js:98:9)
    at Object.valueToNode (/home/hosuaby/projects/my-timesheet/node_modules/@babel/types/lib/converters/valueToNode.js:92:58)
    at Object.exit (/home/hosuaby/projects/my-timesheet/node_modules/istanbul-lib-instrument/dist/visitor.js:641:30)
    at PluginPass.exit (/home/hosuaby/projects/my-timesheet/node_modules/istanbul-lib-instrument/dist/instrumenter.js:104:29)
    at newFn (/home/hosuaby/projects/my-timesheet/node_modules/@babel/traverse/lib/visitors.js:177:21)
    at NodePath._call (/home/hosuaby/projects/my-timesheet/node_modules/@babel/traverse/lib/path/context.js:53:20)
    at NodePath.call (/home/hosuaby/projects/my-timesheet/node_modules/@babel/traverse/lib/path/context.js:40:17)
    at NodePath.visit (/home/hosuaby/projects/my-timesheet/node_modules/@babel/traverse/lib/path/context.js:99:8)
    at TraversalContext.visitQueue (/home/hosuaby/projects/my-timesheet/node_modules/@babel/traverse/lib/context.js:103:16)
    at TraversalContext.visitSingle (/home/hosuaby/projects/my-timesheet/node_modules/@babel/traverse/lib/context.js:77:19)

🌍 Your Environment

Node: v16.4.2
Angular: 12.2.10

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions