Call transform() directly — no HTTP stack needed. For stateless pipes, instantiate with new and test each branch. For pipes with injected services, use Test.createTestingModule() to provide mocks and retrieve the pipe via module.get().
Call transform() directly — no need for a full HTTP request in unit tests.
Test all branches: valid input, invalid input, boundary values, and missing input.
For async pipes use await and resolves/rejects matchers from Jest.
Mock injected services with useValue and jest.fn() to control return values per test.
Test the exact exception type and message — BadRequestException vs NotFoundException matters.