Browse Source

Use Map() as cache store in cache tests

extract-response
Luke Childs 8 years ago
parent
commit
b3201ea733
  1. 2
      package.json
  2. 5
      test/cache.js

2
package.json

@ -63,8 +63,6 @@
"form-data": "^2.1.1",
"get-port": "^3.0.0",
"into-stream": "^3.0.0",
"levelup": "^1.3.5",
"memdown": "^1.2.4",
"nyc": "^10.0.0",
"pem": "^1.4.4",
"pify": "^2.3.0",

5
test/cache.js

@ -1,5 +1,4 @@
import test from 'ava';
import levelup from 'levelup';
import got from '../';
import {createServer} from './helpers/server';
@ -25,7 +24,7 @@ test.before('setup', async () => {
});
test('Non cacheable requests are not cached', async t => {
const cache = levelup('/no-cache', {db: require('memdown')});
const cache = new Map();
const firstResponse = parseInt((await got(`${s.url}/no-cache`, {cache})).body, 10);
const secondResponse = parseInt((await got(`${s.url}/no-cache`, {cache})).body, 10);
@ -34,7 +33,7 @@ test('Non cacheable requests are not cached', async t => {
});
test('Cacheable requests are cached', async t => {
const cache = levelup('/cache', {db: require('memdown')});
const cache = new Map();
const firstResponse = await got(`${s.url}/cache`, {cache});
const secondResponse = await got(`${s.url}/cache`, {cache});

Loading…
Cancel
Save