Книга: Angular 2 Cookbook
Назад: Setting up an application with Angular CLI
Дальше: Creating a minimum viable unit test suite with Karma, Jasmine, and TypeScript

Chapter 9. Angular 2 Testing

This chapter will cover the following recipes:

  • Creating a minimum viable unit test suite with Karma, Jasmine, and TypeScript
  • Writing a minimum viable unit test suite for a simple component
  • Writing a minimum viable end-to-end test suite for a simple application
  • Unit testing a synchronous service
  • Unit testing a component with a service dependency using stubs
  • Unit testing a component with a service dependency using spies

Introduction

Writing tests is like brushing your teeth. You can get away with skipping it for a while, but it'll catch up with you eventually.

The world of testing is awash with conflicting ideologies, platitudes, and grandstanding. What's more, there is a dizzying array of tools available that allow you to write and run your tests in different ways, automate your tests, or analyze your test coverage or correctness. On top of that, each developer's utility and style of testing is unique; someone hacking away at a pre-seed startup will not have the same requirements as a developer that is part of a large team inside a Fortune 500 company.

The goal of this chapter is to walk you through the available testing utilities that the Angular 2 framework comes with out of the box, as well as some strategies for deploying these utilities. The recipes will focus on unit tests rather than E2E tests, as an overwhelming majority of robust test suites will be unit tests.

Назад: Setting up an application with Angular CLI
Дальше: Creating a minimum viable unit test suite with Karma, Jasmine, and TypeScript

thank you
Flame
cant read the code since it is all on a single line. Also this comments section is russian
Rakuneque
DATA COLLECTION AND ANALYSIS Two reviewers extracted data and assessed methodological quality independently lasix torsemide conversion Many others were in that space already