Skip to content
This repository has been archived by the owner on Sep 16, 2021. It is now read-only.

fix: fix formatting of Karma stack traces #369

Closed
wants to merge 1 commit into from

Conversation

vikerman
Copy link
Contributor

Make the paths(with and without sourcemaps) relative to the project root so that the file locations are linkified in editors like VS Code.

Tested in angular/angular using VS Code.

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature (please, look at the "Scope of the project" section in the README.md file)
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Karma error stacks used to look like this.

    Expected true to be false.
        at UserContext.eval (http://concatjsangular/packages/core/test/application_init_spec.ts:19:31 <- http://concatjangular/packages/core/test/application_init_spec.js:27:41)
        at TestBedViewEngine.execute (http://concatjsangular/packages/core/testing/src/test_bed.ts:486:14 <- http://concatjsangular/packages/core/testing/src/test_bed.js:372:23)
        at UserContext.eval (http://concatjsangular/packages/core/testing/src/test_bed.ts:690:39 <- http://concatjsangular/packages/core/testing/src/test_bed.js:542:49)
        at ZoneDelegate.invoke (http://concatjsnode_modules/zone.js/dist/zone.js:388:26)

What is the new behavior?

Karma error stacks look like this now and clickable from VS Code terminal.

    Expected true to be false.
        at UserContext.eval (packages/core/test/application_init_spec.ts:19:31 <- angular/packages/core/test/application_init_spec.js:27:41)
        at TestBedViewEngine.execute (packages/core/testing/src/test_bed.ts:486:14 <- angular/packages/core/testing/src/test_bed.js:372:23)
        at UserContext.eval (packages/core/testing/src/test_bed.ts:690:39 <- angular/packages/core/testing/src/test_bed.js:542:49)
        at ZoneDelegate.invoke (node_modules/zone.js/dist/zone.js:388:26)

Does this PR introduce a breaking change?

  • Yes
  • No

@vikerman vikerman requested review from filipesilva and removed request for alexeagle December 28, 2018 04:28
Copy link
Contributor

@filipesilva filipesilva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reasonable way we could test this is working as intended?

@vikerman vikerman force-pushed the master branch 5 times, most recently from 63696af to 1bac7de Compare January 30, 2019 00:31
Make the paths(with and without sourcemaps) relative to the project root so that the file locations are linkified in editors like VS Code.

Tested in angular/angular using VS Code.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants