add test for cache ejection

This commit is contained in:
Randall Schmidt 2020-11-27 22:27:59 -05:00
parent 8833c2276e
commit 49741e9608

@ -80,6 +80,22 @@ describe('Cache tests', function() {
res = await fetch(TWO_HUNDRED_URL);
assert.strictEqual(res.fromCache, true);
});
it('Can eject from cache', async function() {
res = await fetch(TWO_HUNDRED_URL);
assert.strictEqual(res.fromCache, false);
res = await fetch(TWO_HUNDRED_URL);
assert.strictEqual(res.fromCache, true);
await res.ejectFromCache();
res = await fetch(TWO_HUNDRED_URL);
assert.strictEqual(res.fromCache, false);
res = await fetch(TWO_HUNDRED_URL);
assert.strictEqual(res.fromCache, true);
});
}).timeout(10000);
describe('Data tests', function() {