FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

test: add error classification unit tests by bugparty · Pull Request #527 · imapsync/imapsync · GitHub

test: add error classification unit tests - #527

Open
bugparty wants to merge 20 commits into
imapsync:masterfrom
bugparty:master
Open

test: add error classification unit tests#527
bugparty wants to merge 20 commits into
imapsync:masterfrom
bugparty:master

Conversation

Copy link
Copy Markdown

Summary

  • Add 9 unit tests covering classifyError() and custom error class properties in src/errors.ts
  • Tests verify all 5 error type mappings (auth, connection, message, folder, cache) plus the unknown fallback
  • Tests verify MessageCopyError.folder/.uid, FolderError.folder, and the optional cause property on all 5 error classes

Test plan

  • npx jest --runTestsByPath src/__tests__/unit/errors.test.ts --verbose — 9/9 pass
  • npx tsc --noEmit — clean
  • npx jest --verbose — 39/39 pass (full suite)

🤖 Generated with Claude Code

bugparty and others added 20 commits May 9, 2026 19:11
Modular pipeline architecture using imapflow + SQLite cache,
replacing Perl's monolithic single-file design.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
13-task plan covering project scaffold, types, error classes,
logger, SQLite cache, config, ImapClient, folder/message ops,
flags/labels, OAuth2, sync orchestrator, CLI, and integration tests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
TDD approach: tests written first (verified fail), then implementation.
- Error classes: ImapConnectionError, ImapAuthError, MessageCopyError, FolderError, CacheError
- classifyError() function mapping errors to ErrorType
- Logger with info/warn/error/progress/summary methods
- Formatters for timestamp, progress, and summary output
- 4 passing unit tests for logger

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- listFolderMessages: skip FETCH 1:* when mailbox.exists === 0
  (empty mailbox has no sequence numbers, Dovecot rejects it)
- CLI: add --no-ssl1/--no-ssl2 negation flags for connecting
  to non-TLS servers (e.g. local Dovecot for testing)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Copy link
Copy Markdown
Member

I don't understand anything of this...

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL