visionmedia/supertest — pull request #89 by RomanMinkin (2013-12-16 00:38:19+00:00)
Title: Added check fields.hasOwnProperty(field)

Hi everyone,

I added additional check for object's own property, so the test logic skips inherited values for `Test._fields = {}`

```JavaScript
// fields
for (var field in fields) {
if (fields.hasOwnProperty(field)) {
// logic code here
}
}
```

In cases when Javascript `Object` type is extended with custom fields/methods, for example:
```JavaScript
Object.prototype.andCheck = function () {
actual++;
}
```
`supertest`'s `lib/test.js:183` throws errors like:

```JavasScript
Error: expected "andCheck" header field
```

In my case it happened when I tried to use `supertest` with Mocha and [Assertion counting](https://github.com/visionmedia/mocha/wiki/Assertion-counting)