- Integration tests using Jest
- How to setup a testing database
- Seeding with Prisma
- Factory pattern for tests using Faker
- The default responses are:
200
- Successful GET request201
- Successful POST request204
- Successful DELETE request401
- Auth errors404
- Resource not found409
- Resource conflict on POST requests422
- Body validation error on POST requests
POST /signup
- Route for creating a new user
- body:{
"email": "jon@doe.com",
"password": "DonJoe27"
}
- response: {"token": "JWT_TOKEN"}
POST /signin
- Route for signing an existing user
- body:{
"email": "jon@doe.com",
"password": "DonJoe27"
}
- Response: {"token": JWT_TOKEN}
POST /tests
- Route for creating new tests
- headers: {"Authorization": "Bearer TOKEN"}
- body: {
"name": "Matrixes and vector space",
"pdfUrl": "https://mywebsite.com/linearAlgebra/firstExam.pdf",
"categoryId": "1",
"disciplineId": "5",
"teacherId": "6",
}
GET /tests/disciplines
- Route for finding all tests organized by terms and disciplines
- headers: {"Authorization": "Bearer TOKEN"}
- Response: array of tests
GET /credentials/teachers
- Route for finding all tests organized by teachers
- headers: {"Authorization": "Bearer TOKEN"}
- Response: credential