Sharing Top Content from the Angular-sphere.

Mocking with Angular: More than just unit testing – Austin – Medium

  • Once both teams have a agreement, the respective teams can go off and start their work.Fake EndpointsIn order for the UI to start progression while the backend is still in works, you need some way to mock the response from the data.
  • This requires the front-end users to run the backend while its very unstable, lead time for the back-end developers to build this out and they maintain it making it difficult to get different data for your testingFrontend API functions don’t actually call any backend but just hardcode the data in….
  • When you run your application in dev mode, instead of calling out the the API endpoint, the In Memory DB will intercept it instead and return this data for us.You can see a end-to-end demo of this here: do we improve quality with mocking?If we look at the in memory db…
  • This is a essential tool in any programmers toolbar.Putting it all togetherHaving the ability to quickly make fake services returning random data gives us maximum efficiency to develop quality code quickly.
  • We no longer have to lag behind backend teams, wait for fake endpoints or hardcode data in our services with tools and methods like these.

When one speaks of mocking in the programming circles, we often think of mocking objects for unit testing. While this is a very valuable practice, there are intrinsic benefits we often overlook that…

Mocking with Angular: More than just unit testingWhen one speaks of mocking in the programming circles, we often think of mocking objects for unit testing. While this is a very valuable practice, there are intrinsic benefits we often overlook that we can do with mocking. I’m going to show you how to increase your development speed and improve quality (outside of unit tests) with mocking. Have I got your attention?How do you increase development speed with mocking?In many organizations, the responsibilities of front-end and back-end are split between teams. A new project kicks off and we as front-end developers typically lag behind the back-end team hooking up services once they become available. But what if both teams could work in parallel? What do we need to achieve this?API Specs API specifications describe the models and the endpoints of the service contract. They serve as a single source of truth for the contract between the client and the backend. There are numerous tools out there to help achieve this in a standardize format like like OpenAPI (f.k.a. Swagger) or RAML.Everyone should be involved in this process of flushing out this spec. It should be no different than going over business requirements. Once both teams have a agreement, the respective teams can go off and start their work.Fake EndpointsIn order for the UI to start progression while the backend is still in works, you need some way to mock the response from the data. Typically I see this done in 2 different ways:Backend developers create…

Mocking with Angular: More than just unit testing – Austin – Medium

Comments are closed, but trackbacks and pingbacks are open.