test: add infrastructure utilities and events tests#10
Merged
Conversation
Add comprehensive test coverage for: - query-result-formatter: assets/expenses formatting, user aggregation - date.utils: all 4 format functions with edge cases - logger: log levels, output routing, object pretty-printing - container: register/get/factory/has/remove/clear - telegram utils: account maps, getCashAccount, getCardAccount, getAccountByEmail - message-queue.service: enqueue, dedup, complete, timeout, clearByMerchant - beancount-query.service: queryByDateRange, executeQuery error handling - dbs-transaction-extractor: amount formats, missing fields, rounding - email-parser-factory: find/register/parse with custom parsers Overall coverage: 46.92% → 60.78% Co-Authored-By: Claude Opus 4.6 (1M context) <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.
Background
Part of Phase 2 (Task 008) to achieve 90%+ test coverage. Overall coverage improved from 46.92% to 60.78%.
Approach
Added unit tests for infrastructure utilities, event system, and email parser modules. All external dependencies mocked.
Changes
query-result-formatter.test.ts— 6 tests: formatting, user aggregation, empty results, unmapped accountsdate.utils.test.ts— 8 tests: all 4 format functions with edge caseslogger.test.ts— 12 tests: log levels, output routing, Error vs non-Error, object printing, createLoggercontainer.test.ts— 8 tests: register/get/factory/has/remove/cleartelegram.test.ts— 8 tests: account maps, getCashAccount, getCardAccount, getAccountByEmailmessage-queue.service.test.ts— 8 tests: enqueue, dedup, complete, timeout, clearByMerchantbeancount-query.service.test.ts— +2 tests: queryByDateRange, executeQuery errordbs-transaction-extractor.test.ts— 9 tests: amount formats, missing fields, roundingemail-parser-factory.test.ts— 4 tests: find/register/parse with custom parsersTesting
Code Review