This PR adds in error handling try/catch code to the reports endpoints, to check for server errors and requiredParameters as needed in the request payload. It also implements tests for the endpoints.
Where should the reviewer start?
The new reports.test.js file contains the new tests.
Background Info
I installed Sinon to mock the Puppeteer functionality. Run npm install sinon to get that installed. That allowed the POST test to pass (for a time). That test is currently failing, and I'm not sure why. The functionality is still working perfectly, as I tested that in Postman. I ran two migrations to add a CASCADE delete functionality on the reports table. Run knex migrate:latest and knex migrate:latest --env=test to get up to speed with those new migrations.
What does this PR do?
This PR adds in error handling
try/catch
code to thereports
endpoints, to check for server errors and requiredParameters as needed in the request payload. It also implements tests for the endpoints.Where should the reviewer start?
The new
reports.test.js
file contains the new tests.Background Info
I installed Sinon to mock the Puppeteer functionality. Run
npm install sinon
to get that installed. That allowed the POST test to pass (for a time). That test is currently failing, and I'm not sure why. The functionality is still working perfectly, as I tested that in Postman. I ran two migrations to add a CASCADE delete functionality on the reports table. Runknex migrate:latest
andknex migrate:latest --env=test
to get up to speed with those new migrations.Issues Closed
Closes #30 Closes #34