koa-lite/test/response/remove.js

15 lines
311 B
JavaScript
Raw Normal View History

'use strict';
2017-05-11 03:30:32 +00:00
const assert = require('assert');
const context = require('../helpers/context');
describe('ctx.remove(name)', () => {
it('should remove a field', () => {
const ctx = context();
ctx.set('x-foo', 'bar');
ctx.remove('x-foo');
2017-05-11 03:30:32 +00:00
assert.deepEqual(ctx.response.header, {});
2015-10-12 20:36:41 +00:00
});
});