From a9d06bd797ebc83df61b1572dcb64e167eae893a Mon Sep 17 00:00:00 2001 From: chris48s Date: Mon, 11 Jun 2018 20:07:17 +0100 Subject: [PATCH] only set initial value of LONG_CACHE once --- lib/request-handler.spec.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/request-handler.spec.js b/lib/request-handler.spec.js index 2d820939f8233..97cf5a09e65b4 100644 --- a/lib/request-handler.spec.js +++ b/lib/request-handler.spec.js @@ -33,11 +33,12 @@ describe('The request handler', function() { before(analytics.load); let camp; - let initialLongCache; + const initialLongCache = process.env.LONG_CACHE; + beforeEach(function (done) { camp = Camp.start({ port: config.port, hostname: '::' }); camp.on('listening', () => done()); - initialLongCache = process.env.LONG_CACHE; + process.env.LONG_CACHE = initialLongCache; }); afterEach(function (done) { clearRequestCache(); @@ -45,7 +46,6 @@ describe('The request handler', function() { camp.close(() => done()); camp = null; } - process.env.LONG_CACHE = initialLongCache; }); describe('the options object calling style', function() {