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: concat arrays in babelOptions #43

Merged
merged 1 commit into from
Jun 12, 2019

Conversation

buschtoens
Copy link
Contributor

What: babelOptions.plugins cannot be used together with fixture tests, as the plugin config gets overridden.

Why: To allow setups like:

pluginTester({
  plugin: myPlugin,
  fixtures: join(__dirname, '__fixtures__'),
  babelOptions: {
    plugins: ['@babel/plugin-syntax-class-properties']
  }
});
// __fixtures__/example/options.json
{
  "foo": "bar"
}

How: Replaced lodash.merge with lodash.mergeWith with the following customizer:

function mergeCustomizer(objValue, srcValue) {
  if (Array.isArray(objValue)) {
    return objValue.concat(srcValue)
  }
  return undefined
}

I found the test setup a bit confusing, but I hope that I added a good test scenario.

@buschtoens buschtoens changed the title fix: concat arrays in babel babelOptions fix: concat arrays in babelOptions Jun 11, 2019
@codecov-io
Copy link

codecov-io commented Jun 11, 2019

Codecov Report

Merging #43 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #43   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           1      1           
  Lines         129    132    +3     
  Branches       32     33    +1     
=====================================
+ Hits          129    132    +3
Impacted Files Coverage Δ
src/index.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 556ca0d...aa8e799. Read the comment docs.

@kentcdodds kentcdodds merged commit b63e8e1 into babel-utils:master Jun 12, 2019
@kentcdodds
Copy link
Member

@all-contributors please add @buschtoens for code and tests

1 similar comment
@kentcdodds
Copy link
Member

@all-contributors please add @buschtoens for code and tests

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.

3 participants