Page MenuHomePhabricator

MCS uses integration tests which are slow.
Open, LowPublic

Description

Tests with mocked responses are easy to write, quick to run, stable, and focused. We should prefer them where possible. This task encompasses the work to convert one existing test from a live network request to a mocked response so we'll have a good pattern to follow for the remaining tests.

Similarly, @Jdlrobson writes:

A lot of the logic in MCSs methods is tested only by tests that run against the response of the api. This makes running npm test slow which makes it hard to do big refactors.

I'd like to create some unit tests for existing functionality.

Event Timeline

An interesting idea I heard mentioned by Stephen at our retrospective meeting a while ago is to try a similar approach some Android unit tests are done by having a MockWebServer feeding canned responses. I guess in the MCS cases these would most likely be mock the responses from MW action API or Parsoid.

A quick web search showed a few interesting options:

Might be worth checking those or similar out.

Jdlrobson renamed this task from Convert one test to use mocked data to MCS uses integration tests which are slow..Aug 7 2017, 1:47 PM
Jdlrobson updated the task description. (Show Details)
Jdlrobson subscribed.
Aklapper lowered the priority of this task from Medium to Low.Jul 24 2023, 1:37 PM