Skip to content

Commit

Permalink
Merge pull request #224 from twokul/fix
Browse files Browse the repository at this point in the history
Fix presets array bug
  • Loading branch information
Kelly Selden committed May 26, 2018
2 parents fcc6c89 + 18c751d commit 194c847
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Expand Up @@ -223,7 +223,7 @@ module.exports = {

options.presets = [
shouldRunPresetEnv && this._getPresetEnvPlugins(addonProvidedConfig),
]
].filter(Boolean);

if (shouldCompileModules) {
options.moduleIds = true;
Expand Down
18 changes: 18 additions & 0 deletions node-tests/addon-test.js
Expand Up @@ -791,6 +791,24 @@ describe('ember-cli-babel', function() {
expect(result.plugins).to.deep.include(plugin);
});

it('sets `presets` to empty array if `disablePresetEnv` is true', function() {
let options = {
'ember-cli-babel': {
disablePresetEnv: true,
}
};
this.addon.parent = {
options: {
babel6: {
plugins: [ {} ]
},
},
};

let result = this.addon.buildBabelOptions(options);
expect(result.presets).to.deep.equal([]);
});

it('user plugins are before preset-env plugins', function() {
let plugin = function Plugin() {};
this.addon.parent = {
Expand Down

0 comments on commit 194c847

Please sign in to comment.