Improves dealing with pending tests #165

Closed
wants to merge 7 commits into from

7 participants

@ixti

right now you are allowed to only replace test function with string (which also makes no sense). So if you want "stub" some test without "failing" the suite you might do it as follows:

{
  'foo': 'bar'/* function (result) {
    assert.equal(result, 'good');
  }*/,
}

More than that test is simply marked s pending. This patch allows to have more sexy way to mark tests as pending:

specify reason of disabling test

{
  'foo': 'not sure about what to test yet'
}

throw "pending" right from the test

{
  'foo': function (result) {
    throw {pending: 'this feature is planned but not implemented'};
    assert.equal(result, 'good');
  }
}

You can omit message, in this case it will output same as it works now. With given message, it will be appended just like for the broken test.

@ixti

Can somebody clarify is core team interested in this feature or not at all?
It's 2 month old now. And as I need it for myself I would like to know
opinion of core team to reflect my own infrastructure.

PS If this is interesting. I think that would be great to add ability to
skip test and mark them as skipped by throwing {skip: "message"}.

@puzrin

Any news on accepting/rejecting this pull request?

@osher

+1

@JerrySievert

@ixti can you provide an example of output with this change?

thanks!

@ixti

Hmm I don't remember exactly but it was similar to existing "pending" tests but with allowing to show "message" why is it was marked as pending.

In fact we're not interested in this feature anymore.
Thanks for you notice anyway.

@ixti ixti closed this Aug 14, 2012
@ixti

I must clarify my last statement.

I needed this feature to be able to skip "time-expansive" tests on CI environment for example, but it can be achieved in something like this:

if (/* my condition here */) {
  vows.describe('time-expansive test').addBatch({
    // ...
  });
}
@colin-jack

Pity, seems like a very useful feature and far better than the current comment out approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment