> > > On Tue, Jul 17, 2012 at 2:43 AM, Dominic Tarr <dominic.t...@gmail.com> 
> > > wrote: 
> > >> 
> > >> _everyone_ a strong opinion on this. 
> > >> 
> > >> our test frameworks need to be rewritten now that we have domains. 
> > >> 
> > >> maybe, write through exercises in the book? 
> > >>
> > On Tue, Jul 17, 2012 at 1:44 AM, Nuno Job <nunojobpi...@gmail.com> wrote: 
> > > There's no test runner for all frameworks. 
> > > 
> > > That would be a great idea though but it's very unlikely that someone 
> > > reaches a compromise between features that is acceptable for different
> > > test framework developers. 
> > > 
> > > Nuno 
> On Tuesday, July 17, 2012 9:49:41 AM UTC+1, jesusabdullah wrote:
> >
> > > There's no test runner for all frameworks. 
> >
> > I use one that's pretty sweet, it's called `node`. ;) 
> >
> > (nevermind that vows tests usually export instead of run.) 
> >
> > --Josh 

On Tue, Jul 17, 2012 at 03:13:44AM -0700, Alex Young wrote:

> The CommonJS test module uses those export-based tests, and somehow I've 
> been assuming this is the 'right' way to write tests.  It seems like there 
> are three options:

> * CommonJS unit testing module style
> * Mocha (and similar) where a program is used to execute the test because 
> it contains top-level functions without relying on a require
> * A plain old Node script

I've created Proof. It is a test framework that I created that I'm enjoying.

Proof is a test runner that runs tests that emit plain old TAP. You give it a
file blog pattern and it runs the tests that match the glob.

https://github.com/bigeasy/proof#tests-run-in-parallel

With Proof, the test name is where you put your TDD messaging. As you can see
from the example, organize your tests in directories and give the files a
meaningful name.

A Proof test is a program. Your test can fail in spectacular ways and Proof will
keep on running your test suite.

Proof can run tests in parallel simply by spawning more processes. Each
directory is a suite. The tests in a suite are run serially, but different
suites can be run in parallel, a test from each suite.

A Proof test is just a Node.js program, or any program that emits TAP. For
example, I wrote a test in Ruby to verify my time zone library against Ruby's
`strftime`. It runs right along side my Node.js tests.

Proof encourages you to create many, many little test programs. If you have a
problem, you can run them directly. You can debug by spewing whatever you like
to stdout, because the Proof runner will ignore it and hide it. You can launch
in a debugger to test just the bit you want to test.

Proof provides you with a library to create a test harness. This library has a
snappy invocation, so that you can get going with a shebang line and one line of
preamble. State the number of expected tests and provide a function to run.

https://github.com/bigeasy/proof#every-test-is-a-program

Proof provides a Step-like async control flow library, so you can bang out async
tests really quickly.

https://github.com/bigeasy/proof#step-by-step-asynchronous-tests

Of course, a Proof test is just a program.

Proof also runs on Windows. It converts your UNIX file globs for your. It does a
pretty good job of sorting out the shebang line. It still runs tests in their
own process.

Proof has nice reporting on Travis CI. It takes advantage of the console there
to show you your test program, then report any errors in detail.

http://travis-ci.org/#!/bigeasy/cadence/jobs/1857606

I'll have to consider how domains fit into the library.

--
Alan Gutierrez - http://github.com/bigeasy  - http://twitter.com/bigeasy

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to