Reducing Duplication in Unit Tests

Readability is important when it comes to any type of code. Concise tests are not only faster to write, but with the correct abstraction, they can assist the reader in understanding the behavior of the corresponding production code.

In this screencast, we refactor the unit tests for the Posts.vue component, extracting a createWrapper utility function which can be used to simplify unit tests throughout the entire codebase.

A text version of this screencast is available here. It was published on 12th Jan, 2020.


Register your email to get occasional emails about new screencasts and courses!
Thanks for registering!