feat: systematically achieve 90% test coverage per file - #930
Open
avoidwork wants to merge 15 commits into
Open
Conversation
Closes #929 - proposal.md: motivation and scope for achieving 90% line coverage - design.md: technical approach, mocking strategy, c8 ignore decisions - tasks.md: 27 tasks across 7 groups (spreadsheet, calendar, email, core) - specs/test-coverage/spec.md: requirements and scenarios for test coverage
better-sqlite3's fromConnString with file: URIs doesn't reliably resolve paths or create parent directories. Create the Database instance directly with an absolute path, ensure parent dirs exist, and set WAL mode manually.
Switch from sync fs (mkdirSync, existsSync) to async fs/promises (mkdir). mkdir with recursive: true is idempotent, so the exists check is no longer needed. Update the call site in index.js and all tests to handle the async function.
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.
What
Systematically achieve ≥90% line coverage per file across the madz codebase. This PR establishes the OpenSpec change framework and task plan.
Scope
In Scope
c8 ignore nextannotations for genuinely untestable pathsOut of Scope
Technical Approach
node --test(built-in, no dependencies)c8via--experimental-test-coveragesinon-style manual mocks ornode:testmock modulefsmockspinotest helpers// c8 ignore nextfor platform-specific code, unresolvable error paths, and live-credential dependenciesTasks
See
openspec/changes/achieve-90-percent-test-coverage/tasks.mdfor the full task breakdown (27 tasks across 7 groups).Priority Files (by coverage)
src/tools/spreadsheet/formulaParser.jssrc/tools/calendar/index.jssrc/tools/email/providers/graph.jssrc/tools/email/providers/gmail.jssrc/tools/compactContext/index.jssrc/tools/email/providers/imap.jssrc/tools/spreadsheet/pivot.jssrc/tools/calendar/providers/msgraph.jssrc/tools/calendar/providers/google.jssrc/tools/spreadsheet/stats.jssrc/tools/spreadsheet/spreadsheet.jsVerification
Closes #929