blob: 8ff01a1bdaadeb0d4183002b6f447d8f17467974 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
'use strict';
const assert = require('assert');
const cache = require('../lib/index.js').create({
file: __dirname + '/ga-api-cache.json'
});
cache.clear();
assert.equal(cache.size(), 0);
cache.set('key', 1, {
life: 3
});
assert.equal(cache.size(), 1);
assert.equal(cache.get('key'), 1);
setTimeout(() => assert.equal(cache.get('key'), null), 5000);
|