Skip to content

test: add comprehensive unit and e2e test coverage#200

Merged
dianaKhortiuk-frontegg merged 3 commits intonextfrom
feat/comprehensive-test-coverage
Apr 14, 2026
Merged

test: add comprehensive unit and e2e test coverage#200
dianaKhortiuk-frontegg merged 3 commits intonextfrom
feat/comprehensive-test-coverage

Conversation

@dianaKhortiuk-frontegg
Copy link
Copy Markdown
Collaborator

Summary

  • Add 14 new unit spec files covering all major untested modules (authenticator, identity token-resolvers, exceptions, events client, redis cache, package-loader, entitlements helpers/mappers/storage)
  • Add e2e test suite (8 flows) against real Frontegg sandbox — not run in CI, manual only via npm run test:e2e
  • Raise coverage thresholds from 17/24/20/18% to 70/70/65/70%

Coverage

Metric Before After
Statements 17% 89%
Branches 24% 79%
Functions 20% 90%
Lines 18% 89%

Test counts

  • Unit: 28 suites, 228 tests (all pass)
  • E2E: 8 suites, 22 tests (manual only, gated behind env vars)

E2E note

E2E tests are excluded from CI. They live in src/__e2e__/ and are picked up only by jest.e2e.config.js (separate from the main jest.config.js). Run locally with:

npm run test:e2e

Requires FRONTEGG_API_KEY and FRONTEGG_CLIENT_ID env vars (see .env.e2e.example).

Test plan

  • npm test passes (228 unit tests green)
  • npm run test:e2e passes locally (22 e2e tests green)
  • Coverage thresholds met
  • TypeScript compiles cleanly (tsc --noEmit)
  • No e2e tests in CI pipeline

🤖 Generated with Claude Code

dianaKhortiuk-frontegg and others added 3 commits April 14, 2026 15:03
Increase test coverage from ~17% to ~89% across the SDK.

- Add 14 new unit spec files covering authenticator, identity token-resolvers,
  exceptions, events client, redis cache, package-loader, and entitlements
  helpers/mappers/storage utilities
- Add e2e test suite (8 flows) against real Frontegg sandbox, gated behind
  env vars and excluded from CI (run manually via npm run test:e2e)
- Add shared test utilities in src/__test-utils__/
- Raise coverage thresholds from 17/24/20/18 to 70/70/65/70
- Add jest.e2e.config.js, .env.e2e.example, npm run test:e2e script

Unit: 28 suites, 228 tests
E2E: 8 suites, 22 tests (manual only, not in CI)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix max-len in fixtures.ts (break long import)
- Add eslint-env node to jest.e2e.config.js
- Remove unused vars in e2e tests

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- axios ^1.7.4 → ^1.15.0 (fixes GHSA-43fc-jf86-j433, GHSA-3p68-rc4w-qgx5, GHSA-fvcv-3m26-pcqx)
- jsonwebtoken ^9.0.2 → ^9.0.3 (fixes GHSA-869p-cjfg-cm3x via jws upgrade)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dianaKhortiuk-frontegg dianaKhortiuk-frontegg merged commit 14d70ee into next Apr 14, 2026
5 checks passed
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