Skip to content

Speed up tests

Tamlyn Rhodes requested to merge yld/pubsweet-client:test-mock-api into master
  • Previously tests set up a new app with a full yarn install just to get a mock server to talk to
  • Only one out of 214 tests used the response from the server
  • Mocking the API responses reduced the test run time from >1m30s to <8s
  • Removed 400+ lines of test helpers
  • Coverage is identical
  • Also converted the tests I edited to async/await style

I appreciate there's a lot to review in this MR. The two commits are logically separated so it may help to review them independently.

Edited by Tamlyn Rhodes

Merge request reports