Skip to content

fix(test): fix test coverage when testing linked libs - #7447

Merged
hansl merged 1 commit into
angular:masterfrom
valorkin:fix-test-cc-for-libs
Aug 20, 2017
Merged

fix(test): fix test coverage when testing linked libs#7447
hansl merged 1 commit into
angular:masterfrom
valorkin:fix-test-cc-for-libs

Conversation

@valorkin

Copy link
Copy Markdown
Contributor

Hey

As you may know, angular-cli is used for testing and deploying doc pages for ngx-bootstrap
Several days ago code coverage just stopped to work, with log you can see above.

@hansl I will really appreciate if you can consider this PR for nearest release

- [x] bug report -> please search issues before submitting

Versions.

@angular/cli: 1.3.1
node: 7.10.0
os: darwin x64
@angular/cli: 1.3.1
@angular/common: 2.4.10
@angular/compiler: 2.4.10
@angular/compiler-cli: 2.4.10
@angular/core: 2.4.10
@angular/forms: 2.4.10
@angular/http: 2.4.10
@angular/language-service: 2.4.10
@angular/platform-browser: 2.4.10
@angular/platform-browser-dynamic: 2.4.10
@angular/router: 3.4.10
@angular/tsc-wrapped: 0.5.1

same for angular v4.3+

Repro steps.

  1. git clone git@github.com:valor-software/ngx-bootstrap.git
  2. npm i
  3. ng test -sr -cc

The log given by the failure.

20 08 2017 18:34:49.664:ERROR [karma]: Error: Module build failed: SyntaxError: 'import' and 'export' may appear only with 'sourceType: module' (1:0)
    at Parser.pp$5.raise (/Users/valorkin/work/open-source/ngx-bootstrap/node_modules/babylon/lib/index.js:4454:13)
    at Parser.pp$1.parseStatement (/Users/valorkin/work/open-source/ngx-bootstrap/node_modules/babylon/lib/index.js:1881:16)
    at Parser.parseStatement (/Users/valorkin/work/open-source/ngx-bootstrap/node_modules/babylon/lib/index.js:5835:22)
    at Parser.pp$1.parseBlockBody (/Users/valorkin/work/open-source/ngx-bootstrap/node_modules/babylon/lib/index.js:2268:21)
    at Parser.pp$1.parseTopLevel (/Users/valorkin/work/open-source/ngx-bootstrap/node_modules/babylon/lib/index.js:1778:8)
    at Parser.parse (/Users/valorkin/work/open-source/ngx-bootstrap/node_modules/babylon/lib/index.js:1673:17)
    at Object.parse (/Users/valorkin/work/open-source/ngx-bootstrap/node_modules/babylon/lib/index.js:7221:37)
    at Instrumenter.instrumentSync (/Users/valorkin/work/open-source/ngx-bootstrap/node_modules/istanbul-lib-instrument/dist/instrumenter.js:121:31)
    at Instrumenter.instrument (/Users/valorkin/work/open-source/ngx-bootstrap/node_modules/istanbul-lib-instrument/dist/instrumenter.js:176:32)
    at Object.module.exports (/Users/valorkin/work/open-source/ngx-bootstrap/node_modules/istanbul-instrumenter-loader/index.js:25:25),Module build failed: SyntaxError: 'import' and 'export' may appear only with 'sourceType: module' (1:0)
    at Parser.pp$5.raise (/Users/valorkin/work/open-source/ngx-bootstrap/node_modules/babylon/lib/index.js:4454:13)
    at Parser.pp$1.parseStatement (/Users/valorkin/work/open-source/ngx-bootstrap/node_modules/babylon/lib/index.js:1881:16)
    at Parser.parseStatement (/Users/valorkin/work/open-source/ngx-bootstrap/node_modules/babylon/lib/index.js:5835:22)
    at Parser.pp$1.parseBlockBody (/Users/valorkin/work/open-source/ngx-bootstrap/node_modules/babylon/lib/index.js:2268:21)
    at Parser.pp$1.parseTopLevel (/Users/valorkin/work/open-source/ngx-bootstrap/node_modules/babylon/lib/index.js:1778:8)
    at Parser.parse (/Users/valorkin/work/open-source/ngx-bootstrap/node_modules/babylon/lib/index.js:1673:17)
    at Object.parse (/Users/valorkin/work/open-source/ngx-bootstrap/node_modules/babylon/lib/index.js:7221:37)
    at Instrumenter.instrumentSync (/Users/valorkin/work/open-source/ngx-bootstrap/node_modules/istanbul-lib-instrument/dist/instrumenter.js:121:31)
    at Instrumenter.instrument (/Users/valorkin/work/open-source/ngx-bootstrap/node_modules/istanbul-lib-instrument/dist/instrumenter.js:176:32)
    at Object.module.exports (/Users/valorkin/work/open-source/ngx-bootstrap/node_modules/istanbul-instrumenter-loader/index.js:25:25),Module build failed: SyntaxError: 'import' and 'export' may appear only with 'sourceType: module' (1:0)

Desired functionality.

Code coverage should work as expected

Mention any other details that might be useful.

For some reason .tmp folder files got included in test coverage report

@hansl

hansl commented Aug 20, 2017

Copy link
Copy Markdown
Contributor

Hi @valorkin,

fix(test) is not an actual scope. This seems like it's fix(@angular/cli). I'll reword your commit, but please keep that in mind next times you submit PR.

@hansl
hansl merged commit 0111f18 into angular:master Aug 20, 2017
@valorkin
valorkin deleted the fix-test-cc-for-libs branch August 20, 2017 19:26
@valorkin

Copy link
Copy Markdown
Contributor Author

sure, thank you!

@angular-automatic-lock-bot

Copy link
Copy Markdown

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.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Sep 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants