ianb / doctestjs

Javascript testing made easy and explicit
http://ianb.github.io/doctestjs/
MIT License
142 stars 10 forks source link

Markup for known-failing test #30

Open ianb opened 12 years ago

ianb commented 12 years ago

There are often tests that are broken, but you know are broken. Basically they represent pending work, not a regression. A bit of markup for these would be nice. Off the top of my head:

thisDoesNotWork();
/* = FAILING
=> what it should do
*/

Not sure if I like or dislike using caps to signify special control structures in the comments. @ is also often used, e.g., @failing or @when The = is intended to go with the core markup, =>.

ianb commented 12 years ago

Note that we don't make the distinction between error and failure like many test systems do (typically failing means an assertion didn't work, while an error is something like an unexpected exception). I don't personally see that distinction as interesting, especially since in practice "failure" is often just as dangerous or hard to fix as "error".

Other tests note these with "skip" or something, meaning a test we don't want to do. Abort() is used a bit like that here, or when could be used like that. But I'd like these tests to actually run, just to be sorted as known-failing. Is there a word for this?