Skip to content

test(sample/10): add e2e tests for fastify sample#16576

Closed
mahmoodhamdi wants to merge 1 commit intonestjs:masterfrom
mahmoodhamdi:test/sample-10-fastify-e2e
Closed

test(sample/10): add e2e tests for fastify sample#16576
mahmoodhamdi wants to merge 1 commit intonestjs:masterfrom
mahmoodhamdi:test/sample-10-fastify-e2e

Conversation

@mahmoodhamdi
Copy link

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe: Adding missing e2e tests

What is the current behavior?

The sample/10-fastify application has no e2e tests. The test:e2e script in package.json outputs "No e2e tests implemented yet."

What is the new behavior?

Added an e2e test for the Fastify platform sample that verifies:

  • GET /cats returns all cats wrapped by the global TransformInterceptor in the { data: [...] } format
  • The test uses FastifyAdapter matching the sample's runtime configuration
  • CatsService is overridden with a mock to isolate the test from data persistence

Also updated the test:e2e script to use the jest configuration.

Does this PR introduce a breaking change?

  • Yes
  • No

Add e2e tests to the Fastify platform sample application:

- Test that GET /cats returns all cats wrapped by
  the global TransformInterceptor in { data } format
- Uses FastifyAdapter matching the sample's runtime configuration
- Add jest-e2e.json configuration for the test runner
- Update test:e2e script in package.json to use jest config
@coveralls
Copy link

Pull Request Test Coverage Report for Build 7f7c9e5f-f7d6-440c-af10-5840e83701e6

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 89.841%

Totals Coverage Status
Change from base Build d8b80ff4-1c32-4569-a75c-00480f0069ab: 0.0%
Covered Lines: 7473
Relevant Lines: 8318

💛 - Coveralls

@kamilmysliwiec
Copy link
Member

#16391

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.

3 participants