Skip to content

Comments

Add more LiquidCache tests for TTL and expiration behavior#10

Open
FlaringPhoenix wants to merge 1 commit intodevelopmentfrom
codex/refactor-project-source-code-for-modern-standards
Open

Add more LiquidCache tests for TTL and expiration behavior#10
FlaringPhoenix wants to merge 1 commit intodevelopmentfrom
codex/refactor-project-source-code-for-modern-standards

Conversation

@FlaringPhoenix
Copy link
Owner

Motivation

  • Improve test coverage around TTL inspection, disabled expiration, manual deletes, and TTL updates to prevent regressions in expiration logic.
  • Validate lifecycle hooks like onExpire and runtime options such as autoRenew to ensure expected production semantics.

Description

  • Added new test cases in test/LiquidCache.spec.ts to cover: remaining TTL reporting for present/missing keys, disabled expiration (null TTL), that onExpire is not called for manual delete, clearing TTL when updating a key with null, and autoRenew behavior on get.
  • Tests use LiquidCache constructed with option objects (e.g. defaultTTL, onExpire, autoRenew) to exercise runtime options.
  • Kept tests asynchronous where needed using setTimeout to observe expiration side effects.

Testing

  • Ran npm test (which runs npm run build then the test suite); TypeScript build/tests failed due to duplicate identifier errors from conflicting ambient types in @types/jasmine and @types/mocha.
  • No test failures from the new specs themselves were observed locally because the type conflicts prevented the test run from completing.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant