wavded / babel-tape-runner

Babel + Tape runner for your ESNext code
134 stars 16 forks source link

Is this just a shorter way of doing babel-node tests.js | tape? #6

Open barneycarroll opened 9 years ago

barneycarroll commented 9 years ago

Perhaps because the name made me think of tape-run, a tool for running tape tests in a browser process, I lazily guessed this might have something to do with bringing the Babel runtime to the browser and compiling the rest, but trial and error tells me I got that wrong :) Going over the README had me wondering what the essence of this package is about - is it a Windows-compatible CLI for what *nix shell would do with babel-node tests.js | tape, or is there something else going on?

wavded commented 9 years ago

@barneycarroll its the runner you get with tape (that supports things like globs) with babel registered as to pick up your .babelrc settings and babel modules. i believe it should work with Windows but I haven't tried. runs tests on the command line, no browser support.

barneycarroll commented 9 years ago

God knows what Windows users are getting TBH ;P – So this is basically a way of avoiding manually invoking babel and tape as separate strings on the command line?

wavded commented 9 years ago

Just ran this on Windows, works the same as on *nix. You can't pipe babel-node into tape bin but it does behave like tape in that is supports globs so I usually do something like this in my package.json

"scripts": {
    "test": "babel-tape-runner \"**/*-test.js\""
},
fraserxu commented 8 years ago

Hi @wavded , is there anyway that I could pipe the test result to another test reporter?

I need something like babel-tape-runner my-test.js | snazzy, currently I could not find it work so I guess pipe is not supported here?

wavded commented 8 years ago

Not sure how you are consuming the output but the TAP is sent through STDOUT so you could pipe if you wanted to work with that output however if anything else writing to STDOUT it probably would break.

fraserxu commented 8 years ago

Yes, sorry about my previous comment. I made some mistakes about the reporter, it works great for me now and thanks for the module!

Wilfred commented 8 years ago

See https://github.com/wavded/babel-tape-runner/issues/15#issuecomment-210386730

mindplay-dk commented 4 years ago

Related question, is this any different from tape -r @babel/register?

Seems a lot simpler than replacing the test-runner itself?