Learn Vue JS course Learn Javascript and Vue JS Learn VueJS course Learn VueJS Tutorial

Test with Jest

Get access to the most comprehensive Vue.js video library in the world. Over 300 video lessons including the newest Vue 3 features.

Customizable Options

In the previous lesson, we implemented a more sophisticated architecture for our record method, which inevitably can be customized to different use cases. In this lesson, we'll refactor our Model class, so we can overrule the field we use as the primary key in our collection. As with every lesson in this chapter, we'll do this following the test-driven development principles by writing our specs first, before we implement the features.

If you haven’t refactored your test suite according to the previous lesson, to use the createModel function, we advise you to pause the video and do so now or to download the source code before you continue.