https://github.com/joakin/mocha-babel-watch-test
A test repo with mocha, babel compilation and test watching
https://github.com/joakin/mocha-babel-watch-test
Last synced: about 1 year ago
JSON representation
A test repo with mocha, babel compilation and test watching
- Host: GitHub
- URL: https://github.com/joakin/mocha-babel-watch-test
- Owner: joakin
- Created: 2015-12-03T12:20:53.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-12-03T12:25:46.000Z (over 10 years ago)
- Last Synced: 2025-02-18T19:55:39.779Z (over 1 year ago)
- Language: JavaScript
- Size: 1000 Bytes
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# mocha-babel-watch-test
Test repo to check mocha + babel when watching files.
Illustrates the bug https://github.com/mochajs/mocha/issues/1847
When requiring mocha functions to not use globals, watching doesn't work.
```sh
npm install
mocha-babel-watch-test $ mocha -w --compilers js:babel-register test.js
Array
#indexOf()
✓ should return -1 when the value is not present
1 passing (82ms)
# Modify the test.js file
0 passing (0ms)
```
If you uncomment the mocha import line, the watcher works fine.
```js
// Comment this to have it work but use evil global variables
import { describe, it } from 'mocha'
```