SIGN IN SIGN UP

feat(cookies): add cookie assertions

Add a convenient workflow for running assertions on cookie headers
returned by the server. This code is largely copied from Gregory
Langais' package `expect-cookie` (MIT License).

Example usage:
```js
const request = require('supertest');
const cookies = request.cookies;

request(app)
  .get('/users')
  .expect('Content-Type', /json/)
  .expect('Content-Length', '15')
  .expect(200)
  // assert 'alpha' cookie is set with domain, path, and httpOnly options
  .expect(cookies.set({ name: 'alpha', options: ['domain', 'path', 'httponly'] }))
  // assert 'bravo' cookie is NOT set
  .expect(cookies.not('set', { name: 'bravo' }))
  .end(function(err, res) {
    if (err) {
      throw err;
    }
  });
```

Supports:
- `.set` - Assert that cookie and options are set.
- `.reset` - Assert that cookie is set and was already set (in request
  headers).
- `.new` - Assert that cookie is set and was NOT
  already set (NOT in request headers).
- `.renew` - Assert that cookie is set with a strictly greater `expires`
  or `max-age` than the given value.
- `.contain` - Assert that cookie is set with value and contains
  options.
- `.not` - Call any cookies assertion method with "assert true" modifier
  set to `false`.

feat(cookies): add cookie assertions

Add a convenient workflow for running assertions on cookie headers
returned by the server. This code is largely copied from Gregory
Langais' package `expect-cookies` (MIT License).

Example usage:
```js
const request = require('supertest');
const cookies = request.cookies;

request(app)
  .get('/users')
  .expect('Content-Type', /json/)
  .expect('Content-Length', '15')
  .expect(200)
  // assert 'alpha' cookie is set with domain, path, and httpOnly options
  .expect(cookies.set({ name: 'alpha', options: ['domain', 'path', 'httponly'] }))
  // assert 'bravo' cookie is NOT set
  .expect(cookies.not('set', { name: 'bravo' }))
  .end(function(err, res) {
    if (err) {
      throw err;
    }
  });
```

Supports:
- `.set` - Assert that cookie and options are set.
- `.reset` - Assert that cookie is set and was already set (in request
  headers).
- `.new` - Assert that cookie is set and was NOT
  already set (NOT in request headers).
- `.renew` - Assert that cookie is set with a strictly greater `expires`
  or `max-age` than the given value.
- `.contain` - Assert that cookie is set with value and contains
  options.
- `.not` - Call any cookies assertion method with "assert true" modifier
  set to `false`.
D
Dolan Murvihill committed
4f89680e728a79af570e6d58a6289d8eba3db23a
Parent: 076228a