From ae5ecd57ee83bba1872ecacb4534d258b7cd3efc Mon Sep 17 00:00:00 2001 From: Kornel Date: Mon, 10 Feb 2020 22:13:14 +0000 Subject: [PATCH] Add status to tests --- test/updatetest.js | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/test/updatetest.js b/test/updatetest.js index 93e1dbc..53d33b4 100644 --- a/test/updatetest.js +++ b/test/updatetest.js @@ -65,14 +65,23 @@ function assertUpdates( secondRequest, secondResponse ) { + firstResponse = withHeaders(firstResponse, { foo: 'original', 'x-other': 'original' }); + if (!firstResponse.status) { + firstResponse.status = 200; + } + secondResponse = withHeaders(secondResponse, { + foo: 'updated', + 'x-ignore-new': 'ignoreme', + }); + if (!secondResponse.status) { + secondResponse.status = 304; + } + const headers = notModifiedResponseHeaders( firstRequest, - withHeaders(firstResponse, { foo: 'original', 'x-other': 'original' }), + firstResponse, secondRequest, - withHeaders(secondResponse, { - foo: 'updated', - 'x-ignore-new': 'ignoreme', - }) + secondResponse ); assert(headers); assert.equal(headers['foo'], 'updated');