alessandro trinca tornidor
test: update playwright e2e tests because of the new /thesaurus-inflated-phrase agnostic response structure
7149fa6
Prompt for regenerating integration tests
Create a TypeScript script that downloads Swagger/OpenAPI definitions from the following URLs: http://localhost:3000/swagger.json Download the swagger file and save them to a local directory called 'swaggers' and use axios for the HTTP requests
Testing Pattern:
Generate TypeScript types or interfaces from the swagger schema Generate TypeScript helper utilities for:
- An error handler that uses util.inspect to handle circular references
- A request wrapper around axios that handles authentication and error enhancement
Testing Requirements:
Using the Typescript definition from swaggers folder, generate a complete Jest test suite with the following requirements:
- Use TypeScript with proper typing
- Include setup for dotenv configuration
- Implement tests for all CRUD operations
- Handle authentication via Bearer token from environment variables
- Include proper error handling with util.inspect for circular references
- Create helper functions for common test operations
- Implement test data cleanup after tests complete
Detailed Output
Create comprehensive error handling tests for the API endpoints in the Swagger definition. Include tests for:
- Invalid input data
- Missing required fields
- Resource not found scenarios