Book Image

Building Large-Scale Web Applications with Angular

By : Chandermani Arora, Kevin Hennessy, Christoffer Noring, Doguhan Uluca
Book Image

Building Large-Scale Web Applications with Angular

By: Chandermani Arora, Kevin Hennessy, Christoffer Noring, Doguhan Uluca

Overview of this book

<p>If you have been burnt by unreliable JavaScript frameworks before, you will be amazed by the maturity of the Angular platform. Angular enables you to build fast, efficient, and real-world web apps. In this Learning Path, you'll learn Angular and to deliver high-quality and production-grade Angular apps from design to deployment.</p> <p>You will begin by creating a simple fitness app, using the building blocks of Angular, and make your final app, Personal Trainer, by morphing the workout app into a full-fledged personal workout builder and runner with an advanced directive building - the most fundamental and powerful feature of Angular.</p> <p>You will learn the different ways of architecting Angular applications using RxJS, and some of the patterns that are involved in it. Later you’ll be introduced to the router-first architecture, a seven-step approach to designing and developing mid-to-large line-of-business apps, along with popular recipes. By the end of this book, you will be familiar with the scope of web development using Angular, Swagger, and Docker, learning patterns and practices to be successful as an individual developer on the web or as a team in the Enterprise.</p> <p>This Learning Path includes content from the following Packt products:</p> <p><span style="background-color: transparent;">•Angular 6 by Example by Chandermani Arora, Kevin Hennessy&nbsp;</span><br /><span style="background-color: transparent;">•Architecting Angular Applications with Redux, RxJS, and NgRx by Christoffer Noring</span><br /><span style="background-color: transparent;">•Angular 6 for Enterprise-Ready Web Applications by Doguhan Uluca</span></p>
Table of Contents (23 chapters)
Title Page
Copyright
Contributors
About Packt
Preface
Index

Marble testing


Testing asynchronous code can be challenging. For one, we have the time factor. The way we specify what operators to use for our crafted algorithm leads to the algorithm taking anywhere from 2 seconds to 30 minutes to execute. Therefore, it will at first feel like there is no point in testing it, because it can't be done within a reasonable time. We have a way to test RxJS, though; it is called Marble testing and it allows us to control how fast time passes so we have a test that can execute it in milliseconds.

The idea of a Marble is known to us. We can represent one or many streams and the effect an operator has one two or more streams. We do this by drawing the streams as a line and values as circles on the lines. The operator is shown as verb below the input streams. Following operator is a third stream, the result of taking the input streams and applying the operator, a so - called marble diagram. The line represents a continuous timeline. We take this concept and bring...