Last active
January 7, 2016 14:43
-
-
Save justinobney/6834249eb249c32a86af to your computer and use it in GitHub Desktop.
Test setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"presets": [ | |
"es2015", | |
"stage-2" | |
] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const identity = (x) => x; | |
export const square = (x) => x * x; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--compilers js:babel-register | |
test.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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", | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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