Skip to content

Commit

Permalink
fix restored tests
Browse files Browse the repository at this point in the history
  • Loading branch information
runspired committed Jan 29, 2020
1 parent 58b4483 commit bc897e1
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions node-tests/addon-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1000,19 +1000,19 @@ describe('ember-cli-babel', function() {
});

it('provides an annotation including parent name - addon', function() {
this.addon.parent = {
this.addon.parent = Object.assign({}, this.addon.parent, {
name: 'derpy-herpy',
dependencies() { return {}; },
};
});
let result = this.addon.buildBabelOptions();
expect(result.annotation).to.include('derpy-herpy');
});

it('provides an annotation including parent name - project', function() {
this.addon.parent = {
name() { return 'derpy-herpy'; },
this.addon.parent = Object.assign({}, this.addon.parent, {
name: 'derpy-herpy',
dependencies() { return {}; },
};
});
let result = this.addon.buildBabelOptions();
expect(result.annotation).to.include('derpy-herpy');
});
Expand Down Expand Up @@ -1059,27 +1059,27 @@ describe('ember-cli-babel', function() {

it('does not include all provided options', function() {
let babelOptions = { blah: true };
this.addon.parent = {
this.addon.parent = Object.assign({}, this.addon.parent, {
dependencies() { return {}; },
options: {
babel: babelOptions,
},
};
});

let result = this.addon.buildBabelOptions();
expect(result.blah).to.be.undefined;
});

it('includes user plugins in parent.options.babel.plugins', function() {
let plugin = {};
this.addon.parent = {
this.addon.parent = Object.assign({}, this.addon.parent, {
dependencies() { return {}; },
options: {
babel: {
plugins: [ plugin ]
},
},
};
});

let result = this.addon.buildBabelOptions();
expect(result.plugins).to.deep.include(plugin);
Expand All @@ -1088,15 +1088,15 @@ describe('ember-cli-babel', function() {
it('includes postTransformPlugins after preset-env plugins', function() {
let plugin = {};
let pluginAfter = {};
this.addon.parent = {
this.addon.parent = Object.assign({}, this.addon.parent, {
dependencies() { return {}; },
options: {
babel: {
plugins: [ plugin ],
postTransformPlugins: [ pluginAfter ]
},
},
};
});

let result = this.addon.buildBabelOptions();

Expand All @@ -1111,29 +1111,29 @@ describe('ember-cli-babel', function() {
disablePresetEnv: true,
}
};
this.addon.parent = {
this.addon.parent = Object.assign({}, this.addon.parent, {
dependencies() { return {}; },
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 = {
this.addon.parent = Object.assign({}, this.addon.parent, {
dependencies() { return {}; },
options: {
babel: {
plugins: [ plugin ]
},
},
};
});

let result = this.addon.buildBabelOptions();
expect(result.plugins[0]).to.equal(plugin);
Expand Down Expand Up @@ -1183,12 +1183,12 @@ describe('ember-cli-babel', function() {

it('passes options.babel through to preset-env', function() {
let babelOptions = { loose: true };
this.addon.parent = {
this.addon.parent = Object.assign({}, this.addon.parent, {
dependencies() { return {}; },
options: {
babel: babelOptions,
},
};
});

let options = this.addon.buildBabelOptions();

Expand Down

0 comments on commit bc897e1

Please sign in to comment.