visionmedia/mocha — pull request #461 by adomokos (2012-06-14 02:32:11+00:00)
Title: Setting tests to pending with code inside

Sometimes I have a failing spec at the end of a work session. I usually make them pending, therefore it's very easy for me to pick up where I left off.
I have the option to easily ```xit```, but that replaces the spec with a noop function and nothing is reported back.

I had to comment out my entire content like this to make the spec pending:

```javascript
describe('pending', function() {
it('can contain code');
// , function() {
// true.should.be.false;
// });
});
```

I wanted to make it easy to set a spec pending. I [added](https://github.com/adomokos/mocha/commit/b03b47c54fe53ceca7f4ac687167a3b0d3ddf5e2#L0R96) the ```pending``` function to the context that behaves very similar to ```it```, but it not only creates the Test object, it sets it to pending as well.

This way I can easily make the spec pending by replacing the ```it``` function with ```pending``` and leaving the spec content as it is:

```javascript
describe('pending', function() {
pending('can contain code', function() {
// This fails when it's not pending
true.should.be.false;
});
});
```

When you run the spec, this is reported in the terminal:

```shell
.

✔ 1 test complete (1ms)
• 1 test pending
```