Anything like "assert.inconclusive" in Mocha?

137 views
Skip to first unread message

Marc Stober

unread,
Feb 6, 2015, 3:27:08 PM2/6/15
to moc...@googlegroups.com
Hi,

I have a test that, for certain reasons won't run in certain environments. (For example, in different browsers.)

I'd like these tests to appear as "skipped" and I found this solution on StackOverflow to do so: http://stackoverflow.com/questions/19075792/unit-tests-for-optional-units/19149003#19149003

But this feels kind of inelegant - I guess I'm expecting something like the "assert.inconclusive" feature that .NET has.

Any best practices or plans to support something like this?

Thanks in advance, Marc

Miroslav Bajtoš

unread,
Feb 11, 2015, 12:58:58 PM2/11/15
to moc...@googlegroups.com
I wish too that mocha supported something like "assert.inconclusive".

In LoopBack.io, we have extended it/describe with additional methods that resolve e.g. to `it.skip` or `it` depending on the environment:

  it.inBrowser('clears local storage', function() {
    // the test
  });

Miroslav
Reply all
Reply to author
Forward
0 new messages