test: add coverage regression protection
- Add Istanbul ignore comments for intentionally untested code - frontmatter-utils.ts: Buffer.from fallback (unreachable in Jest/Node) - note-tools.ts: Default parameter and response building branches - Add tests for error message formatting (error-messages.test.ts) - Add coverage thresholds to jest.config.js to detect regressions - Lines: 100% (all testable code must be covered) - Statements: 99.7% - Branches: 94% - Functions: 99% Result: 100% line coverage on all modules with regression protection. Test count: 512 → 518 tests (+6 error message tests)
This commit is contained in:
@@ -295,6 +295,7 @@ export class FrontmatterUtils {
|
||||
try {
|
||||
// Validate base64 encoding (will throw on invalid data)
|
||||
// This validates the compressed data is at least well-formed
|
||||
/* istanbul ignore else - Buffer.from fallback for non-Node/browser environments without atob (Jest/Node always has atob) */
|
||||
if (typeof atob !== 'undefined') {
|
||||
// atob throws on invalid base64, unlike Buffer.from
|
||||
atob(trimmedJson);
|
||||
|
||||
Reference in New Issue
Block a user