From 585584d2f7d31acdf77e52b74e0f5b80f5e8453c Mon Sep 17 00:00:00 2001 From: Zachary Golba Date: Thu, 22 Sep 2016 17:48:31 -0400 Subject: [PATCH] test: improve luxify test coverage (#409) --- src/packages/luxify/test/luxify.test.js | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/packages/luxify/test/luxify.test.js b/src/packages/luxify/test/luxify.test.js index bd0465da..0d0484d3 100644 --- a/src/packages/luxify/test/luxify.test.js +++ b/src/packages/luxify/test/luxify.test.js @@ -4,13 +4,21 @@ import { it, describe } from 'mocha'; import luxify from '../index'; +import K from '../../../utils/k'; import setType from '../../../utils/set-type'; describe('module "luxify"', () => { describe('#luxify()', () => { - const [request, response] = setType(() => [{}, {}]); + const [request, response] = setType(() => [ + {}, + { + getHeader: K, + setHeader: K, + removeHeader: K + } + ]); - it('promisifies a callback based function', () => { + it('promisifies a callback based middleware function', () => { const subject = luxify((req, res, next) => { next(); }); @@ -61,5 +69,13 @@ describe('module "luxify"', () => { expect(err).to.be.a('error'); }); }); + + it('properly proxies untrapped response properties', () => { + luxify((req, res) => { + expect(res.getHeader).to.be.a('function'); + expect(res.setHeader).to.be.a('function'); + expect(res.removeHeader).to.be.a('function'); + }); + }); }); });