Skip to content

Commit 59ae93a

Browse files
authored
Chore: Cache test (#36)
1 parent 8d6a867 commit 59ae93a

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

src/util/__tests__/Cache-test.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ describe('Cache', () => {
1212
sandbox.verifyAndRestore();
1313
});
1414

15-
it('should set and get correctly', () => {
15+
it('should set, get and unset correctly', () => {
1616
cache.set('foo', 'bar');
1717
assert.ok(cache.has('foo'));
1818
assert.equal(cache.get('foo'), 'bar');
@@ -29,6 +29,19 @@ describe('Cache', () => {
2929
});
3030

3131
it('should return undefined when not set', () => {
32+
cache.set('foo1', 'bar1');
33+
cache.set('foo2', 'bar2');
34+
cache.set('foo3', 'bar3');
35+
assert.equal(cache.get('foo1'), 'bar1');
36+
assert.equal(cache.get('foo2'), 'bar2');
37+
assert.equal(cache.get('foo3'), 'bar3');
38+
cache.unsetAll('foo');
39+
assert.equal(cache.get('foo1'), undefined);
40+
assert.equal(cache.get('foo2'), undefined);
41+
assert.equal(cache.get('foo3'), undefined);
42+
});
43+
44+
it('should properly unset all', () => {
3245
assert.equal(cache.get('foobar'), undefined);
3346
});
3447

0 commit comments

Comments
 (0)