fix: make better-sqlite3 optional in tests and doctor#399
Merged
Conversation
better-sqlite3 is an optional peer dependency, so tests that require it should be skipped when it's not installed. This allows the test suite to pass in CI environments that don't have better-sqlite3. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The doctor command now considers it a success if ANY SQLite adapter (better-sqlite3 or node:sqlite) is working, rather than requiring all of them. Missing adapters are shown as warnings instead of failures. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When better-sqlite3 is available but node:sqlite is not (older Node), the doctor should pass (exit 0) with a warning, not fail. Updated test expectation to match the new behavior where ANY available driver means success. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Problem
Tests fail when
better-sqlite3is not installed:packages/storage/src/dlq-adapter.test.ts- direct import of better-sqlite3 failssrc/cli/index.test.ts > CLI > doctor- doctor command exits with error code 1Since
better-sqlite3is an optional peer dependency (withnode:sqliteas an alternative), the tests and doctor command should handle its absence gracefully.Changes
1.
packages/storage/src/dlq-adapter.test.ts2.
src/cli/commands/doctor.tsTest plan
🤖 Generated with Claude Code