azer / prova

Test runner based on Tape and Browserify
Other
333 stars 30 forks source link

Add provify transform #34

Closed MylesBorins closed 8 years ago

MylesBorins commented 10 years ago

This transform will replace all instances of "tap" or "tape" require statements in a script with require('prova'). This closes #2.

MylesBorins commented 10 years ago

Also, I wanted to write some tests to prove this works... but the current npm test is pointing at a file that doesn't exist... and it would not appear that all the tests in the test folder are meant to pass.

What is the current way tests on the repo are run?

azer commented 9 years ago

@TheAlphaNerd how about using the -t parameter?

$ prova test -t provify

Does it work?

MylesBorins commented 9 years ago

We are currently using the -t parameter in our repo. I was just thinking of the particular edge case of people wanting to use prova, but not having to specify prova in their tests.

As our test set grows larger having to augment all of them makes the likelihood of adopting a new tool like prova lower, increases buy in, and in a way is a barrier to entry. I could not come up with a reason to not support this transform by default.

That being said there may be a specific use case I have not envisioned.

I’ll be at oakland.js tomorrow night if you are around and want to chat in person.=

MylesBorins commented 9 years ago

@azer thoughts?

azer commented 9 years ago

If we're testing a library that works on both Node and browsers it would cause consistency since it won't work for Node. I like the solution though.

MylesBorins commented 9 years ago

azer... if someone is testing a lib that is node only wouldn't they then be able to just run it through tape?

How is prova used in this specific instance? Just as a cli runner?

azer commented 9 years ago

@TheAlphaNerd yeah, it's also a runner for node; https://i.cloudup.com/R8KQ8Qwspz.png

MylesBorins commented 9 years ago

Ahhh, now I see how this is a problem.

Using prova in the require allows the test runner to work without running in the browser. Could this potentially be solved by piping tap output into prova as you see many tap reporters working?

That being said perhaps I should close this PR... this could easily be solved by documentation in the README letting people know about provify as a solution to this edge case.

megawac commented 9 years ago

The output of browserify works with node, adding browserify support for node scripts (this would also be useful for #57) whenever -t or -u is specified