We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7538218 commit 9eee012Copy full SHA for 9eee012
1 file changed
lib/cache.test.ts
@@ -381,6 +381,25 @@ describe('TTLCache', () => {
381
expect([null, 'lived']).toContain(result);
382
cache.destroy();
383
});
384
+ it('does not throw when ttlMs is Number.EPSILON', () => {
385
+ const cache = new TTLCache<string>();
386
+
387
+ expect(() => {
388
+ cache.set('key', 'value', Number.EPSILON);
389
+ }).not.toThrow();
390
391
+ cache.destroy();
392
+ });
393
394
+ it('does not throw when ttlMs is a very small positive number', () => {
395
396
397
398
+ cache.set('key', 'value', 0.0001);
399
400
401
402
403
404
it('multiple clear operations work correctly', () => {
405
const cache = new TTLCache<string>();
0 commit comments