summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-cache-semantics/test/misctest.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-cache-semantics/test/misctest.js')
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-cache-semantics/test/misctest.js33
1 files changed, 33 insertions, 0 deletions
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-cache-semantics/test/misctest.js b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-cache-semantics/test/misctest.js
new file mode 100644
index 0000000000..643567d962
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-cache-semantics/test/misctest.js
@@ -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:{}}, {});
+ });
+ });
+});