Skip to content

Instantly share code, notes, and snippets.

@thmsobrmlr
Forked from boneskull/index.js
Last active June 30, 2016 12:43
Show Gist options
  • Save thmsobrmlr/6cae8efc5795bd6e60f469d9bf84b692 to your computer and use it in GitHub Desktop.
Save thmsobrmlr/6cae8efc5795bd6e60f469d9bf84b692 to your computer and use it in GitHub Desktop.
example of Mocha source map support for babel (es2015) and markdown reporter
import {ok} from 'assert';
describe('foo()', () => {
it('should pass', () => {
ok(true);
});
});
{
"name": "mocha-sourcemaps",
"version": "0.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "mocha --reporter markdown --require source-map-support --require babel-register index.spec.js"
},
"keywords": [],
"author": "Christopher Hiller <[email protected]> (https://boneskull.com/)",
"license": "ISC",
"dependencies": {
"babel-preset-es2015": "^6.9.0",
"babel-register": "^6.9.0",
"mocha": "^2.5.3",
"source-map-support": "^0.4.0"
},
"babel": {
"presets": [
"es2015"
]
}
}
@thmsobrmlr
Copy link
Author

Output:

npm test

> [email protected] test /Users/thomas88/Code/mocha-es2016
> mocha --reporter markdown --require source-map-support --require babel-register index.spec.js

# TOC
   - [foo()](#foo)
<a name=""></a>

<a name="foo"></a>
# foo()
should pass.

```js
(0, _assert.ok)(true);
```

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