Skip to content

Instantly share code, notes, and snippets.

@yamadayuki
Last active September 14, 2017 14:34
Show Gist options
  • Save yamadayuki/c5ffc2b9af5da6851230 to your computer and use it in GitHub Desktop.
Save yamadayuki/c5ffc2b9af5da6851230 to your computer and use it in GitHub Desktop.
Babel6でMochaとChaiを使ったテストを書く ref: http://qiita.com/yamadayuki/items/9885c9e126648cd8c5e3
{
"presets": ["es2015"]
}
.
├── .babelrc
├── .eslintrc
├── package.json
└── test
├── setup.js
└── test.spec.js
test
✓ 1 + 2 = 3
1 passing (12ms)
{
...
"scripts": {
"test": "NODE_ENV=test mocha --compilers js:babel-register --recursive $(find test -name '*.spec.js')",
...
},
...
}
import { expect } from 'chai';
describe('test', () => {
it('1 + 2 = 3', () => {
expect(1 + 2).to.equal(3);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment