Skip to content

Instantly share code, notes, and snippets.

@nikolaswise
Created March 3, 2017 17:02
Show Gist options
  • Save nikolaswise/e578767283b9b7d00b13d8b277f1a4ce to your computer and use it in GitHub Desktop.
Save nikolaswise/e578767283b9b7d00b13d8b277f1a4ce to your computer and use it in GitHub Desktop.
es6 module testing with babel tape runner ????
// add.js
export default function (a, b) {
return a + b
}
// test.js
var test = require('tape');
import add from './add';
test('This is a thing!', function (t) {
t.plan(1);
var result = add(1,1)
var expect = 2
t.equal(result, expect, 'This fails.');
});
// cli
$ babel-tape-runner tests/app/test.js | tap-spec
@nikolaswise
Copy link
Author

ERR-OR!:

var _add2 = babelHelpers.interopRequireDefault(_add);
            ^

ReferenceError: babelHelpers is not defined

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment