babel-tape-runner
babel-tape-runner copied to clipboard
Watching
I understand it may not exactly be in the scope of this project but I'm wondering if there's any way to make babel-tape-runner
a long running process similarly to mocha's -w
.
I'm more concerned about minimizing the slow startup time (because of babel overhead) than watching files for changes.
Watching can be easily accomplished with npm-watch
but what I like about mocha -w
is that it makes test feedback instantaneous, probably because it doesn't spin up a new process and require stuff every time files change.
I don't have any plans on supporting watching. A quick look around GH didn't turn up any tape runners with watching built in, have you found any?
That'd be a neat feature! I'm using watch
to do that, in a personal project: https://github.com/nicolaspayot/gym-tracker/blob/master/api/package.json#L12
I tried and failed in every possible way, I could think of -m - wasted well over two weeks now. I couldn't remove and re-require the test files. It just kept add them on the stack instead. Hope someone implement this - assuming this might increase tape
's speed closer to mocha
.
tape-watch keeps a long-running process, but doesn't seem to support transpilers at the moment.
That pretty much lets me get back to mocha/chai. With a huge codebase you want instant test feedback and that can only be achieved by watching for changes.
FYI: tape-watch supports the require flag now so you can use things like babel with it
https://github.com/rstacruz/tape-watch#using-with-babel
Here's an example of using tape-watch instead of babel-tape-runner, from my package.json:
"scripts": {
"test": "babel-tape-runner static/__tests__/* | tap-diff",
"test-watch": "tape-watch -r babel-register static/__tests__/* -o '| ./node_modules/tap-diff/distributions/cli.js'",
Please notice that if you are using tape-watch with @babel/register the line should start with:
tape-watch -r @babel/register ...
Kind of obvious when you know it, but took me a while to figure out.