Forms unit testing

The Form debug info panel can be very useful during development, especially if we adapt the activity log feature from time to time to better suit our needs; the client-side debugging feature powered by Visual Studio is even better, because this allows us to scope into TypeScript variables, subscriptions, and initializers in a truly efficient way. Not to mention the fact that the server-side compilation provided by TypeScript + WebPack + WebPackMiddleware will shield us from most syntax, semantic, and logical programming errors, freeing us from the pests of script-based programming, at least for the most part.

However, what about test-driven development? What if we want to test our forms against some specific use cases? Is there a way we can mock our control's and model's behavior and perform Unit Tests?

The answer is yes; more specifically, thanks to the Reactive approach we chose, we'll be able to unit test our forms just like the rest of our client app using the various open source testing frameworks shipped and/or supported by Angular--Jasmine, Karma, and Protractor--as well as its very own native test environment called Angular testing utilities. We'll talk more about that in Chapter 9, Advanced Topics.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.223.107.85