Skip to content

Instantly share code, notes, and snippets.

@justinobney
Last active January 7, 2016 14:43
Show Gist options
  • Save justinobney/6834249eb249c32a86af to your computer and use it in GitHub Desktop.
Save justinobney/6834249eb249c32a86af to your computer and use it in GitHub Desktop.
Test setup
{
"presets": [
"es2015",
"stage-2"
]
}
export const identity = (x) => x;
export const square = (x) => x * x;
--compilers js:babel-register
test.js
{
"name": "lib.js",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "mocha --opts mocha.opts",
"test:watch": "mocha --opts mocha.opts --watch --reporter min"
},
"author": "Justin Obney",
"license": "MIT",
"devDependencies": {
"babel-preset-es2015": "^6.3.13",
"babel-preset-stage-2": "^6.3.13",
"babel-register": "^6.3.13",
"expect": "^1.13.4",
}
}
import expect from 'expect';
import {identity, square} from './index';
describe('setup', () => {
it('works', () => {
expect(identity(5)).toBe(5);
expect(square(5)).toBe(25);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment