You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
806 B
33 lines
806 B
'use strict';
|
|
|
|
const assert = require('assert');
|
|
const CachePolicy = require('..');
|
|
|
|
|
|
describe('Other', function() {
|
|
it('Thaw wrong object', function() {
|
|
assert.throws(() => {
|
|
CachePolicy.fromObject({});
|
|
});
|
|
});
|
|
|
|
it('Missing headers', function() {
|
|
assert.throws(() => {
|
|
new CachePolicy({});
|
|
});
|
|
assert.throws(() => {
|
|
new CachePolicy({headers:{}}, {});
|
|
});
|
|
|
|
const cache = new CachePolicy({headers:{}}, {headers:{}});
|
|
assert.throws(() => {
|
|
cache.satisfiesWithoutRevalidation({});
|
|
});
|
|
assert.throws(() => {
|
|
cache.revalidatedPolicy({});
|
|
});
|
|
assert.throws(() => {
|
|
cache.revalidatedPolicy({headers:{}}, {});
|
|
});
|
|
});
|
|
});
|
|
|