-
Notifications
You must be signed in to change notification settings - Fork 63
Stripe Test Code Documentation
The apiRouter module is loaded from the ../../api file to define the API routes for the test application.
A test application is created using express and the apiRouter middleware is mounted at the /api endpoint. The afterEach function is called to clear all mocks created by the tests.
A describe block is defined to group related test cases together. The string argument describes the group of test cases being defined, in this case 'GET /api/...'.
A test.skip function is called to define a single test case that is being skipped. The string argument describes the test case being defined, in this case 'fake test'. The expect function is called to assert that true is equal to true.
An afterAll function is defined to wait for 500ms before closing the server to avoid a Jest open handle error.
This test code is designed to test a route in an API by making a GET request to the endpoint and checking if the response is what is expected. However, the actual test case is skipped with the test.skip function, so it will not run until the skip is removed.
- Home
- App Logic
- App Structure
- Getting Started
- Local Environment Setup
- Interacting with the Development Database
- User Background
- Features
- Data Structures
- API Quick Reference
- Single Campaign Mode (Beta)
- Front-end
- Components
- Pages
- State Management
- Amplify API reference (Database)
- Lob Mailing API integration
- Auth0 API Integration
- Stripe API integration
- Cicero API Integration
- Twilio API Integration