Angular-cli: test --code-coverage fails for app project referencing library project on Windows

Created on 17 Aug 2018  路  3Comments  路  Source: angular/angular-cli

Bug Report or Feature Request (mark with an x)

- [X] bug report -> please search issues before submitting
- [ ] feature request

Command (mark with an x)

- [ ] new
- [ ] build
- [ ] serve
- [X] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Versions


Windows 10
node --version: v8.11.3
npm --version: 5.6.0

Angular CLI: 6.0.8
Node: 8.11.3
OS: win32 x64
Angular: 6.1.3
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.6.8
@angular-devkit/build-angular      0.6.8
@angular-devkit/build-ng-packagr   0.6.8
@angular-devkit/build-optimizer    0.6.8
@angular-devkit/core               0.6.8
@angular-devkit/schematics         0.6.8
@angular/cli                       6.0.8
@ngtools/json-schema               1.1.0
@ngtools/webpack                   6.0.8
@schematics/angular                0.6.8
@schematics/update                 0.6.8
ng-packagr                         3.0.6
rxjs                               6.2.2
typescript                         2.7.2
webpack                            4.8.3

Repro steps

The log given by the failure

17 08 2018 10:35:28.972:ERROR [karma]: RangeError: Maximum call stack size exceeded
    at normalizeStringWin32 (path.js:33:30)
    at Object.resolve (path.js:328:20)
    at sync (D:\_src\example-ng6-lib\node_modules\mkdirp\index.js:68:14)
    at sync (D:\_src\example-ng6-lib\node_modules\mkdirp\index.js:77:24)
    at sync (D:\_src\example-ng6-lib\node_modules\mkdirp\index.js:78:17)
    at sync (D:\_src\example-ng6-lib\node_modules\mkdirp\index.js:78:17)
    at sync (D:\_src\example-ng6-lib\node_modules\mkdirp\index.js:78:17)
    at sync (D:\_src\example-ng6-lib\node_modules\mkdirp\index.js:78:17)
    at sync (D:\_src\example-ng6-lib\node_modules\mkdirp\index.js:78:17)
    at sync (D:\_src\example-ng6-lib\node_modules\mkdirp\index.js:78:17)
    at sync (D:\_src\example-ng6-lib\node_modules\mkdirp\index.js:78:17)
    at sync (D:\_src\example-ng6-lib\node_modules\mkdirp\index.js:78:17)
    at sync (D:\_src\example-ng6-lib\node_modules\mkdirp\index.js:78:17)
    at sync (D:\_src\example-ng6-lib\node_modules\mkdirp\index.js:78:17)
    at sync (D:\_src\example-ng6-lib\node_modules\mkdirp\index.js:78:17)
    at sync (D:\_src\example-ng6-lib\node_modules\mkdirp\index.js:78:17)

Desired functionality

Code coverage report should be successfully generated

Mention any other details that might be useful


This seems to work fine in linux, I'm assuming this is a windows-only issue.

devkibuild-angular low inconvenient bufix

Most helpful comment

We fixed this in our project by adding our library dist folder to:
angular.json/projects/${our_project}/architect/test/options/codeCoverageExcludes using a glob ("dist/${our_lib}/*/").

We didn't want our library files showing up in the report anyway, they have their own test & coverage.

Would be nice to have a solution built in.

All 3 comments

We fixed this in our project by adding our library dist folder to:
angular.json/projects/${our_project}/architect/test/options/codeCoverageExcludes using a glob ("dist/${our_lib}/*/").

We didn't want our library files showing up in the report anyway, they have their own test & coverage.

Would be nice to have a solution built in.

worked for me, thanks @james-schwartzkopf!

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

purushottamjha picture purushottamjha  路  3Comments

rajjejosefsson picture rajjejosefsson  路  3Comments

hartjo picture hartjo  路  3Comments

brtnshrdr picture brtnshrdr  路  3Comments

rwillmer picture rwillmer  路  3Comments