Kornel
8 years ago
3 changed files with 79 additions and 2 deletions
@ -0,0 +1,33 @@ |
|||
'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:{}}, {}); |
|||
}); |
|||
}); |
|||
}); |
Loading…
Reference in new issue