Skip to content

Commit

Permalink
Add status to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kornelski committed Feb 10, 2020
1 parent 385b5d3 commit ae5ecd5
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions test/updatetest.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit ae5ecd5

Please sign in to comment.