Skip to content
This repository has been archived by the owner on Dec 31, 2019. It is now read-only.

Reverting config parsing changes to preserve .istanbul.yml functionality #84

Merged
merged 1 commit into from
Nov 5, 2015

Conversation

srapp
Copy link
Contributor

@srapp srapp commented Nov 2, 2015

Commit fb4dea9 introduced a backwards-incompatible change, breaking the expectations that values set in the .istanbul.yml config file would be used if the corresponding parameter wasn't set to override it. For instance, running with isparta@3.1.0 with this .istanbul.yml (notice the non-default values):

verbose: true
instrumentation:
    root: ./app
    default-excludes: false
    include-all-sources: true

and the following command (executed via npm):

babel-node $(npm bin)/isparta cover $(npm bin)/_mocha --compilers js:babel/register -- --recursive

Would result with the following output during coverage:

verbose: true
instrumentation:
    root: ./app
    default-excludes: false
    include-all-sources: true
    ...

However, each version since the aforementioned change disregards certain values in the .istanbul.yaml, specifically root, include-all-sources, and default-excludes, resulting in the following:

verbose: true
instrumentation:
    root: .
    default-excludes: true
    include-all-sources: false
    ...

Turns out it has to do with how the arguments are being passed to Istanbul's configuration functions. For instance, mergeObjects overwrites template values with whatever is being passed in as the override. You'll notice this works for some of the other default parameter values set up here because they're empty arrays (which mergeObjects discards in favor of what has been loaded from the config file).

It's probably worth revisiting how to make this configuration more robust, but I wanted to offer a quick solution to reestablish this functionality quickly, as I (and perhaps others) are going to have to stay pinned to 3.1.0 for the time being.

@douglasduteil
Copy link
Owner

Fixes #84

douglasduteil added a commit that referenced this pull request Nov 5, 2015
Reverting config parsing changes to preserve .istanbul.yml functionality
@douglasduteil douglasduteil merged commit 7561a6c into douglasduteil:master Nov 5, 2015
@douglasduteil
Copy link
Owner

Alright

@douglasduteil
Copy link
Owner

Published in isparta 3.5.3 🚀

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.

2 participants