Skip to content

Conversation

@kentcdodds
Copy link
Collaborator

What: closes #88

Why: Because we document that you can export a function that returns
a configuration, but it doesn't actually work.

How: Add some logic to loadConfig in src/bin-utils/index.js to
handle the case when the config is a function. Also, we need to pass the
input along, so I had to make a few other changes as well. Also added
fixtures and tests for this.

This also adds @erikfox to the contributors table for reporting the bug! Thanks!

**What**: closes #88

**Why**: Because we document that you can export a function that returns
a configuration, but it doesn't actually work.

**How**: Add some logic to `loadConfig` in `src/bin-utils/index.js` to
handle the case when the config is a function. Also, we need to pass the
input along, so I had to make a few other changes as well. Also added
fixtures and tests for this.
@codecov-io
Copy link

Codecov Report

Merging #98 into master will not impact coverage.

@@          Coverage Diff          @@
##           master    #98   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          11     14    +3     
  Lines         260    273   +13     
=====================================
+ Hits          260    273   +13
Impacted Files Coverage Δ
src/bin-utils/fixtures/bad-data-type-config.js 100% <100%> (ø)
src/bin-utils/fixtures/function-config.js 100% <100%> (ø)
src/bin-utils/index.js 100% <100%> (ø)
...in-utils/fixtures/bad-function-data-type-config.js 100% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 033bbda...e57497f. Read the comment docs.

@kentcdodds
Copy link
Collaborator Author

Anyone wanna review this really quick?

@kentcdodds kentcdodds merged commit 3566a15 into master Feb 9, 2017
@kentcdodds kentcdodds deleted the pr/allow-function branch February 9, 2017 16:52
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.

/bin-utils loadJSConfig() doesn't support package-scripts.js exporting a function

4 participants