Set up

Let's set up our environment correctly so we can write marble tests. We need the following:

  • The NPM library jasmine-marbles
  • A scaffolded Angular application

With that we scaffold our Angular project, like so:

ng new MarbleTesting

After the project has been scaffolded, it's time to add our NPM library, like so:

cd MarbleTestingnpm install jasmine-marbles --save

Now we have finished the setup, so the time has come to write tests.

Get Architecting Angular Applications with Redux, RxJS, and NgRx now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.