We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8d6a867 commit 59ae93aCopy full SHA for 59ae93a
1 file changed
src/util/__tests__/Cache-test.js
@@ -12,7 +12,7 @@ describe('Cache', () => {
12
sandbox.verifyAndRestore();
13
});
14
15
- it('should set and get correctly', () => {
+ it('should set, get and unset correctly', () => {
16
cache.set('foo', 'bar');
17
assert.ok(cache.has('foo'));
18
assert.equal(cache.get('foo'), 'bar');
@@ -29,6 +29,19 @@ describe('Cache', () => {
29
30
31
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', () => {
45
assert.equal(cache.get('foobar'), undefined);
46
47
0 commit comments