chore: fix addBabelPresets doc and test babel fns#98
Merged
Conversation
This change installs `jest@^24` and replaces the `test` script with a call to `jest`.
This change adds tests for `addBabelPreset` and `addBabelPresets`. This adds a test case for a reported bug with `addBabelPresets` that was caused by incorrect documentation of the api.
This change adds a note not to pass an array of presets to `addBabelPresets` and removes the passed array in the code example.
Owner
|
@FezVrasta you have a second to give this a quick test run? I haven’t even used CRA in upwards of a year at this point, so I’m barely qualified to accept PR’s to my own project :) |
Owner
|
@with-heart ok I'm just gonna merge these changes. Hey, would you be interested in being a contributor to this project? I'll give you write access to the repo, and publish rights on npm, if you want. |
Owner
|
Published in 0.2.14 |
Collaborator
Author
|
@arackaf Awesome! Also, I'd love that, thank you :) I've had a few ideas brewing that I've been meaning to propose after fleshing out the test suite a little more. |
Owner
|
@with-heart what's your npm username? |
Collaborator
Author
Owner
Collaborator
Author
|
@arackaf it is :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Closes #97
I investigated #97 and discovered that
addBabelPresetsworks similarly toaddBabelPluginsin that it spreads its arguments and then maps them. This means that passing an array of presets instead of a flat list of arguments will result in an array nested one level deeper than expected.Correct usage example:
Changes
readme.mdto not pass an array toaddBabelPresetsaddBabelPresetsarguments in thereadme.mdcode examplejestaddBabelPresetandaddBabelPresetsto guarantee their usage matches this PRtestscript withjestcallcoverage/to.gitignoreforjest --coverageusage