Skip to content

test: add encryption coverage - #215

Merged
h4yfans merged 1 commit into
mainfrom
feat/phase-1-crypto-foundation
Apr 15, 2026
Merged

test: add encryption coverage#215
h4yfans merged 1 commit into
mainfrom
feat/phase-1-crypto-foundation

Conversation

@h4yfans

@h4yfans h4yfans commented Apr 15, 2026

Copy link
Copy Markdown
Collaborator

What

Add dedicated coverage for apps/desktop/src/main/crypto/encryption.ts.

Why

Advance phase 1.2 of the tech-debt remediation plan by giving the crypto encryption layer direct edge-case coverage instead of relying only on broader foundation smoke tests.

How

  • add apps/desktop/src/main/crypto/encryption.test.ts
  • cover round-trip behavior with and without associated data
  • cover tampering, wrong-key, wrong-nonce, AAD mismatch, zero-length payload, and >1 MiB payloads
  • cover encryption/decryption error normalization, linking helpers, and unwrapFileKey cleanup behavior

Type

  • test — adding or updating tests

Test plan

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing (describe below)

Manual verification run locally:

  • pnpm --filter @memry/desktop exec vitest run --config config/vitest.config.ts --project main src/main/crypto/encryption.test.ts
  • pnpm --filter @memry/desktop exec vitest run --coverage --config config/vitest.config.ts --project main src/main/crypto/encryption.test.ts --coverage.thresholds.statements=0 --coverage.thresholds.branches=0 --coverage.thresholds.functions=0 --coverage.thresholds.lines=0
  • pnpm --filter @memry/desktop typecheck:node
  • pnpm --filter @memry/desktop exec vitest run --config config/vitest.config.ts --project main src/main/crypto

Checklist

  • Self-reviewed the diff
  • No hardcoded secrets or credentials
  • Files stay under ~500 LOC
  • Follows immutable data patterns

@h4yfans
h4yfans marked this pull request as ready for review April 15, 2026 21:05
@h4yfans
h4yfans merged commit 690da4e into main Apr 15, 2026
2 checks passed
@h4yfans
h4yfans deleted the feat/phase-1-crypto-foundation branch April 15, 2026 21:05
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.

1 participant