Skip to content

Commit

Permalink
Ensure both inspect and assert are properly supported.
Browse files Browse the repository at this point in the history
  • Loading branch information
rwjblue committed Jul 4, 2017
1 parent 3550cb9 commit 4b644fe
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
2 changes: 1 addition & 1 deletion index.js
Expand Up @@ -260,7 +260,7 @@ module.exports = {
if (this._emberVersionRequiresModulesAPIPolyfill()) {
const ModulesAPIPolyfill = require('babel-plugin-ember-modules-api-polyfill');

return [[ModulesAPIPolyfill, { blacklist: ['@ember/debug'] }]];
return [[ModulesAPIPolyfill, { blacklist: { '@ember/debug': ['assert', 'deprecate', 'warn']} }]];
}
},

Expand Down
20 changes: 20 additions & 0 deletions node-tests/addon-test.js
Expand Up @@ -128,6 +128,26 @@ describe('ember-cli-babel', function() {

expect(contents).to.include('function _asyncToGenerator');
}));

it("allows @ember/debug to be consumed via both debug-macros and ember-modules-api-polyfill", co.wrap(function* () {
input.write({
"foo.js": stripIndent`
import { assert, inspect } from '@ember/debug';
export default { async foo() { await this.baz; }}
`
});

subject = this.addon.transpileTree(input.path());
output = createBuilder(subject);

yield output.build();

let contents = output.read()['foo.js'];

expect(contents).to.include('function _asyncToGenerator');
expect(contents).to.include('var inspect = Ember.inspect;');
expect(contents).to.not.include('assert');
}));
});

describe('debug macros', function() {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -37,7 +37,7 @@
"dependencies": {
"amd-name-resolver": "0.0.6",
"babel-plugin-debug-macros": "^0.1.10",
"babel-plugin-ember-modules-api-polyfill": "^1.3.0",
"babel-plugin-ember-modules-api-polyfill": "^1.4.1",
"babel-plugin-transform-es2015-modules-amd": "^6.24.0",
"babel-polyfill": "^6.16.0",
"babel-preset-env": "^1.5.1",
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Expand Up @@ -438,9 +438,9 @@ babel-plugin-debug-macros@^0.1.1, babel-plugin-debug-macros@^0.1.10, babel-plugi
dependencies:
semver "^5.3.0"

babel-plugin-ember-modules-api-polyfill@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/babel-plugin-ember-modules-api-polyfill/-/babel-plugin-ember-modules-api-polyfill-1.3.0.tgz#0b32e3dfdee47f26942968f49d2d67ba85346ae3"
babel-plugin-ember-modules-api-polyfill@^1.4.1:
version "1.4.1"
resolved "https://registry.yarnpkg.com/babel-plugin-ember-modules-api-polyfill/-/babel-plugin-ember-modules-api-polyfill-1.4.1.tgz#2b05e1b37e492449319a9cc2bdca460cda70b5b1"
dependencies:
ember-rfc176-data "^0.1.0"

Expand Down

0 comments on commit 4b644fe

Please sign in to comment.