Skip to content

Feature/compt 58 test suite#4

Merged
y-aithnini merged 11 commits intodevelopfrom
feature/COMPT-58-test-suite
Apr 3, 2026
Merged

Feature/compt 58 test suite#4
y-aithnini merged 11 commits intodevelopfrom
feature/COMPT-58-test-suite

Conversation

@y-aithnini
Copy link
Copy Markdown

Summary

  • What does this PR change?

Why

  • Why is this change needed?

Checklist

  • Added/updated tests (if behavior changed)
  • npm run lint passes
  • npm run typecheck passes
  • npm test passes
  • npm run build passes
  • Added a changeset (npx changeset) if this affects consumers

Notes

  • Anything reviewers should pay attention to?

Copilot AI review requested due to automatic review settings April 3, 2026 11:17
@y-aithnini y-aithnini requested a review from a team as a code owner April 3, 2026 11:17
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a comprehensive Jest test suite for CacheKit’s core utilities (key resolution, singleton ref), primary service API (CacheService), decorators (@Cacheable/@CacheEvict), module wiring (CacheModule), and both store adapters (in-memory and Redis via ioredis-mock).

Changes:

  • Added unit/integration-style tests across utilities, service, decorators, module, and adapters (including Redis behavior via ioredis-mock).
  • Added ioredis-mock as a dev dependency and updated the lockfile.
  • Updated Jest configuration (raised global coverage thresholds to 85% and enabled forceExit).

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/utils/resolve-cache-key.util.spec.ts Adds unit coverage for placeholder interpolation and edge cases.
src/utils/cache-service-ref.spec.ts Tests singleton accessor behavior and error messaging.
src/services/cache.service.spec.ts Tests CacheService API behavior, TTL resolution, and error propagation in wrap().
src/decorators/cacheable.decorator.spec.ts Verifies cache-aside behavior, TTL forwarding, and sync/async method support.
src/decorators/cache-evict.decorator.spec.ts Verifies post-success eviction behavior, error path, and sync/async support.
src/cache-kit.module.spec.ts Tests dynamic module registration paths and onModuleInit() wiring into CacheServiceRef.
src/adapters/redis-cache-store.adapter.spec.ts Adds Redis adapter contract tests using ioredis-mock.
src/adapters/in-memory-cache-store.adapter.spec.ts Adds in-memory adapter contract + TTL behavior tests.
jest.config.ts Raises coverage thresholds and enables forceExit.
package.json Adds ioredis-mock to devDependencies.
package-lock.json Lockfile updates for ioredis-mock and transitive dependencies.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 3, 2026

@y-aithnini y-aithnini merged commit 8b0d360 into develop Apr 3, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants