From 5ed4456b1a5ff72d43af473f6e7aecfb1cb4cc58 Mon Sep 17 00:00:00 2001 From: Arjun Gadhia Date: Tue, 20 Feb 2018 17:31:48 +0000 Subject: [PATCH] =?UTF-8?q?Allow=20304=20as=20an=20okay=20status=20=20?= =?UTF-8?q?=F0=9F=90=BF=20v2.6.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/smoke/checks.js | 2 +- test/fixtures/smoke-pass.js | 1 + test/tasks/smoke.js | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/smoke/checks.js b/lib/smoke/checks.js index 2bd2c3f..d185aa2 100644 --- a/lib/smoke/checks.js +++ b/lib/smoke/checks.js @@ -12,7 +12,7 @@ module.exports = { result: testPage.check.status === testPage.redirect.to }; } else { - return { expected: testPage.check.status, actual: testPage.status, result: testPage.status === testPage.check.status }; + return { expected: testPage.check.status, actual: testPage.status, result: testPage.status === testPage.check.status || testPage.status === 304 && testPage.check.status === 200 }; } }, diff --git a/test/fixtures/smoke-pass.js b/test/fixtures/smoke-pass.js index cd52d6e..50bfebb 100644 --- a/test/fixtures/smoke-pass.js +++ b/test/fixtures/smoke-pass.js @@ -2,6 +2,7 @@ module.exports = [{ urls: { '/status/200': 200, '/status/204': 204, // this will be skipped because we don't support it yet! + '/status/304': 200, // browsers will sometimes 304, so let's pretend like that is okay '/status/404': { status: 404, content: '404', diff --git a/test/tasks/smoke.js b/test/tasks/smoke.js index 33bfdd0..49fcd7c 100644 --- a/test/tasks/smoke.js +++ b/test/tasks/smoke.js @@ -18,7 +18,7 @@ describe('Smoke Tests of the Smoke', () => { }); return smoke.run() .then((results) => { - expect(results.passed.length).toEqual(10); + expect(results.passed.length).toEqual(11); expect(results.failed.length).toEqual(0); done(); });