Skip to content

Commit ea28663

Browse files
committed
export cache method, and set maxsize to 1 for testing
1 parent e18c386 commit ea28663

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

library/src/methods/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export * from './assert/index.ts';
2+
export * from './cache/index.ts';
23
export * from './config/index.ts';
34
export * from './fallback/index.ts';
45
export * from './flatten/index.ts';

library/src/utils/_Cache/_Cache.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ import { _Cache } from './_Cache.ts';
33

44
describe('_Cache', () => {
55
test('should cache values', () => {
6-
const cache = new _Cache<string, number>();
6+
const cache = new _Cache<string, number>({ maxSize: 1 });
77

88
cache.set('foo', 123);
99
expect(cache.get('foo')).toBe(123);
1010

1111
cache.set('bar', 456);
1212

1313
expect(cache.get('bar')).toBe(456);
14-
// default max size is 1
14+
1515
expect(cache.get('foo')).toBeUndefined();
1616
});
1717
test('should allow deleting', () => {

0 commit comments

Comments
 (0)