Skip to content

@cacheable/node-cache: move store tests to use @faker-js/faker#1641

Merged
jaredwray merged 2 commits into
mainfrom
claude/node-cache-faker-tests-IE0d3
May 26, 2026
Merged

@cacheable/node-cache: move store tests to use @faker-js/faker#1641
jaredwray merged 2 commits into
mainfrom
claude/node-cache-faker-tests-IE0d3

Conversation

@jaredwray

Copy link
Copy Markdown
Owner

Summary

  • Replace all hardcoded string keys/values ("test", "value", "foo", "bar", "test1", "value1", "Alice", "Bob", etc.) in store.test.ts with @faker-js/faker calls (faker.string.uuid(), faker.lorem.word(), faker.person.firstName(), faker.number.int())
  • Aligns store.test.ts with index.test.ts which already used faker throughout
  • Prototype pollution tests (__proto__ key) intentionally left with hardcoded values since they test a specific key

Test plan

  • All 81 tests pass
  • 100% statement and line coverage maintained

https://claude.ai/code/session_01Xba73Vg7fi24yVik8zSjVT


Generated by Claude Code

…er in store tests

Replace all hardcoded string keys/values ("test", "value", "foo", "bar", etc.)
with faker-generated data (faker.string.uuid(), faker.lorem.word(), etc.) for
consistency with index.test.ts and the rest of the monorepo.

https://claude.ai/code/session_01Xba73Vg7fi24yVik8zSjVT

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the test suite in packages/node-cache/test/store.test.ts to use dynamic test data generated by faker instead of hardcoded strings and values. The review feedback suggests improving several assertions on mget results by using toEqual with dynamic object keys rather than checking individual properties, which provides stricter and more robust assertions.

Comment thread packages/node-cache/test/store.test.ts Outdated
Comment thread packages/node-cache/test/store.test.ts Outdated
Comment thread packages/node-cache/test/store.test.ts Outdated
@codecov

codecov Bot commented May 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (9346f94) to head (8bdfa7d).

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1641   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           26        26           
  Lines         2497      2497           
  Branches       556       554    -2     
=========================================
  Hits          2497      2497           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…ore tests

Address review feedback: use toEqual with full object assertions instead of
checking individual properties on mget results, ensuring no unexpected keys.

https://claude.ai/code/session_01Xba73Vg7fi24yVik8zSjVT
@jaredwray jaredwray merged commit d51b5f2 into main May 26, 2026
12 checks passed
@jaredwray jaredwray deleted the claude/node-cache-faker-tests-IE0d3 branch May 26, 2026 15:35
@jaredwray jaredwray mentioned this pull request May 27, 2026
5 tasks
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