Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: handle relative sourceRoots in source map files #100

Merged
merged 1 commit into from May 6, 2020

Conversation

j03m
Copy link
Contributor

@j03m j03m commented Apr 30, 2020

Fixes the issue recorded in #99

For the test case, you can run the new unit test on master as is and you can see the invalid source resolution. With the fix the path is correct.

@j03m
Copy link
Contributor Author

j03m commented Apr 30, 2020

CC: @bcoe

@coveralls
Copy link

coveralls commented Apr 30, 2020

Pull Request Test Coverage Report for Build 437

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.2%) to 95.476%

Totals Coverage Status
Change from base Build 435: 0.2%
Covered Lines: 513
Relevant Lines: 532

💛 - Coveralls

@j03m
Copy link
Contributor Author

j03m commented May 1, 2020

Hmmm, this coverage regression seems incorrect. Only one line of source changed and a new test was added to reflect that.

@j03m j03m force-pushed the fix-relative-sourceRoot branch from c746c7d to 51ab9a6 Compare May 2, 2020 13:59
@j03m
Copy link
Contributor Author

j03m commented May 2, 2020

@bcoe @robpalme I spent a bunch of time trying to understand what could have caused the -0.007% coverage regression here and can't come up with anything other than coveralls must have a rounding error.

I figured the lesser evil of merging a red-x was to cover a previously uncovered branch and bump the number up. Which I did. See inline comments.

@@ -32,6 +32,12 @@ describe('Source', () => {
source.relativeToOffset(2, 50).should.equal(22)
source.relativeToOffset(1, Infinity).should.equal(1)
})

it('returns empty object for out of range params', () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

New test covers a previously uncovered return statement for out of range issues in offsetToOriginalRelative. Added to bump a rounding error out of the previous build.

@bcoe bcoe merged commit 16ad3aa into istanbuljs:master May 6, 2020
@bcoe
Copy link
Member

bcoe commented May 6, 2020

@j03m thanks for the fix 👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants