utils.js
This file
Path
test/support/utils.js
24 lines · 472 bytes · JavaScript
Last changed by
tests: use supertest to check response header valuesDouglas Christopher Wilsonbefore adoption12bc16e
History of this fileTake it
tests: use supertest to check response header valuesDouglas Christopher Wilsonbefore adoption12bc16e
lines 1–24why, one step back12/**3 * Module dependencies.4 * @private5 */6var assert = require('assert');78/**9 * Module exports.10 * @public11 */12exports.shouldNotHaveHeader = shouldNotHaveHeader;1314/**15 * Assert that a supertest response does not have a header.16 *17 * @param {string} header Header name to check18 * @returns {function}19 */20function shouldNotHaveHeader(header) {21 return function (res) {22 assert.ok(!(header.toLowerCase() in res.headers), 'should not have header ' + header);23 };24}