Skip to content

test: add 22 integration tests for critical flows (#83)#104

Merged
MarcosBrendonDePaula merged 1 commit intomainfrom
test/integration-tests-critical-flows
Mar 15, 2026
Merged

test: add 22 integration tests for critical flows (#83)#104
MarcosBrendonDePaula merged 1 commit intomainfrom
test/integration-tests-critical-flows

Conversation

@MarcosBrendonDePaula
Copy link
Copy Markdown
Collaborator

Summary

  • Added 22 integration tests across 6 new test files covering the most critical framework flows
  • Integration test coverage increased from ~11% (68/597) to ~14% (90/619)
  • All 619 tests pass (0 failures)

New test files

File Tests Category
tests/integration/framework/request-lifecycle.test.ts 5 Request → plugin hooks → handler → response
tests/integration/framework/plugin-lifecycle.test.ts 4 Discovery → register → setup → hooks
tests/integration/live/live-components.test.ts 4 Connect → state sync → room → disconnect
tests/integration/auth/auth-flow.test.ts 3 Register → login → session → protected route
tests/integration/build/build-system.test.ts 3 Generator discovery, template engine
tests/integration/config/config-system.test.ts 3 Config modules, validation, framework context

What's tested

  • Request lifecycle: Hook execution order (onRequest → onBeforeRoute → onAfterRoute → onBeforeResponse → onResponse), response modification via hooks, error hook catching, multi-plugin priority ordering, context shape
  • Plugin lifecycle: Lifecycle hook order (setup → onBeforeServerStart → onServerStart → onAfterServerStart), dependency resolution across start(), Elysia route mounting from plugins, plugin context utilities (logger, config, utils)
  • Live Components: Component mount + initial state, action-driven STATE_DELTA emissions, cross-component room event broadcasting, destroy cleanup
  • Auth flow: Full register + login flow, session-based protected route access, unauthenticated 401 rejection
  • Build system: FluxPluginsGenerator discovery, LiveComponentsGenerator component scanning, TemplateEngine variable substitution (kebab, pascal, camel, snake, constant)
  • Config system: All config module exports validated, defineConfig with custom validators, FluxStackFramework context config loading

Closes #83

Test plan

  • All 619 tests pass (597 existing + 22 new)
  • No skipped tests in new files
  • Tests follow existing patterns (app.handle, DI context, mock WebSocket)

🤖 Generated with Claude Code

Add comprehensive integration tests covering 6 critical categories:
- Request lifecycle (5 tests): hook order, response modification, error handling, multi-plugin priority, context inspection
- Plugin lifecycle (4 tests): hook execution order, dependency resolution, Elysia route mounting, plugin context utilities
- Live Components (4 tests): mount/state sync, action-driven deltas, cross-component room broadcasting, destroy cleanup
- Auth flow (3 tests): register+login flow, authenticated protected route, unauthenticated rejection
- Build system (3 tests): plugin generator discovery, live component generator, template engine variable processing
- Config system (3 tests): config module validation, defineConfig with validators, framework context config loading

Closes #83

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@MarcosBrendonDePaula MarcosBrendonDePaula merged commit 4b7f4f4 into main Mar 15, 2026
11 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.

Adicionar 20+ testes de integracao para fluxos criticos

1 participant