Skip to content

Commit

Permalink
Test expired.on returns correct expirey date for instantly stale cache
Browse files Browse the repository at this point in the history
  • Loading branch information
lukechilds committed Dec 23, 2016
1 parent 66cb08c commit edbae35
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/expired.on.js
Expand Up @@ -22,3 +22,16 @@ test('expired.on returns correct expirey date for valid cache', t => {
t.true(isEqual(expired.on(headers), expiredOn));
tk.reset();
});

test('expired.on returns correct expirey date for instantly stale cache', t => {
const date = new Date().toUTCString();
const headers = {
date: date,
age: 0,
'cache-control': `public, max-age=0`
};

tk.freeze(date);
t.true(isEqual(expired.on(headers), date));
tk.reset();
});

0 comments on commit edbae35

Please sign in to comment.