Skip to content

Write tests for routes: api, assets #319

@jaredatron

Description

@jaredatron

We have a serious lack of http request specs for our web application. We need to ensure the route we've written work as expected.

Write tests for

  • web-server/routes/api.js in web-server/routes/api.test.js
  • web-server/routes/assets.js in web-server/routes/assets.test.js

Tips

  • See the tests in web-server/routes/goals.test.js for a pattern guide.
  • If the routes your testing respond with HTML, we might need to find and install a new dependency to help us make assertions about html. Something like chai-html
  • If your route makes database or api calls we might need to use sinon to stub some methods to return some mock objects.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions