[Cross-cutting] Set up comprehensive test infrastructure #45
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR sets up comprehensive test infrastructure for both JavaScript and Rust implementations as requested in issue #23.
JavaScript Changes
vitest.config.jsandvitest.integration.config.jsfor coverage reporting alongside existing test-anywhere for multi-runtime supportjs/tests/fixtures/):sample-links.js: Sample data including simple links, nested links, BigInt links, queue itemsgenerateSequentialLinks()andgenerateRandomLinks()helper functionsjs/tests/helpers/):test-utils.js: Utilities likecreateTestStore(),createPopulatedStore(),retry(),measureTime(),runBenchmark()mock-backend.js: Mock implementations with configurable latency and failure injectiontests/integration/setup.jswith resource cleanup trackingRust Changes
rust/benches/):memory_bench.rs: Benchmarks for MemoryLinkStore (create, get, exists, find, count, update, delete, clear)queue_bench.rs: Benchmarks for MemoryQueue (enqueue, dequeue, peek, depth, roundtrip, bulk operations)rust/tests/fixtures/mod.rs):generate_sequential_links(),generate_random_links())Test Results
New Scripts
JavaScript:
npm run test:coverage- Run tests with Vitest coveragenpm run test:integration- Run integration testsnpm run test:watch- Watch mode for developmentRust:
cargo bench --bench memory_bench- Run memory store benchmarkscargo bench --bench queue_bench- Run queue benchmarksTest Plan
Fixes #23
🤖 Generated with Claude Code