Skip to content

Commit

Permalink
Add failing "transpile moved args" test
Browse files Browse the repository at this point in the history
  • Loading branch information
Turbo87 committed Dec 24, 2017
1 parent 5adb01c commit 36c05bd
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
6 changes: 6 additions & 0 deletions fixtures/transpile-moved-args/expectation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
function wrappedWarn() {
var _console, _console2;

(_console = console).warn.apply(_console, arguments);
(true && (_console2 = console).warn.apply(_console2, arguments));
}
6 changes: 6 additions & 0 deletions fixtures/transpile-moved-args/sample.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { warn } from '@ember/debug-tools';

function wrappedWarn() {
console.warn(...arguments);
warn(...arguments);
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"devDependencies": {
"babel-cli": "^6.22.2",
"babel-core": "^6.22.1",
"babel-plugin-transform-es2015-spread": "^6.22.0",
"babel-preset-env": "^1.2.2",
"babel-preset-latest": "^6.24.0",
"babel-register": "^6.22.0",
Expand Down
25 changes: 25 additions & 0 deletions src/tests/debug-tools-test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import DebugToolsPlugin from '../index';
import { transform } from 'babel-core';
import Es2015Spread from 'babel-plugin-transform-es2015-spread';
import { expect } from 'chai';
import { file } from 'chai-files';
import { lstatSync, writeFileSync } from 'fs';
Expand Down Expand Up @@ -77,6 +78,30 @@ let cases = {
]
},

'transpile moved args': {
transformOptions: {
presets,
plugins: [
Es2015Spread,
[DebugToolsPlugin, {
debugTools: {
source: '@ember/debug-tools',
assertPredicateIndex: 0
},
envFlags: {
source: '@ember/env-flags',
flags: {
DEBUG: true
}
}
}],
]
},
fixtures: [
'transpile-moved-args',
],
},

'foreign debug imports': {
transformOptions: {
presets,
Expand Down

0 comments on commit 36c05bd

Please sign in to comment.