Play by Play is a series in which top technologists work through a problem in real time, unrehearsed, and unscripted. In this course, Play by Play: Fundamentals of Angular Testing, Duncan Hunter and Lars Klint demonstrate the importance of testing in your Angular applications. Learn how to write unit tests using Angular “TestBed” testing helpers, how to write end to end tests with Angular, and how to decide what to test and how much test coverage is right for your team. By the end of this course, you’ll have a good understanding of how to get started writing tests and what the worth is testing in your Angular applications.
Lars is an author, trainer, Microsoft MVP, community leader, authority on
all things Windows Platform, and part time crocodile wrangler. He is heavily
involved in the space of HoloLens and mixed reality, as well as a published
Pluralsight author, freelance solution architect, and writer for numerous
Course Overview Hi everyone. My name is Duncan Hunter. And I am Lars Klint. And welcome to our Play by Play, Testing Angular. I'm a software architect from Brisbane, Australia, where I'm lucky enough to make Angular applications for a range of different clients. And I'm a freelance solution architect at larsklint. com, Microsoft MVP speaker and expert in Australian Outback Internet. Yeah, really. I've been building software systems from tiny websites to massive telecommunication systems for the past 20 years. Testing your Angular applications has huge benefits, both in designing more maintainable code, but also helping you to continue to ship features as your app grows without the fear of breaking existing code. This Play by Play is an introduction to testing angular applications. We'll be looking at how to write your first unit test with Jasmine and Karma and move on to talking about how to create fakes, mocks, and spies. After this, we'll look at using Angular's TestBed testing utility and introduce its async and fakeAsync helper methods. Then we'll look at how to write end-to-end tests with Angular using the Protractor library and how these are fundamentally different to Angular unit tests. By the end of this Play by Play, you should have a good understanding of why and what is web testing in your Angular applications and how to get started writing your first tests. I really hope you'll join us on this journey to learn about testing with Angular applications with the Testing Angular Play by Play, at Pluralsight.
Looking at End-to-End Testing I kind of know what the end bit is now because we talked a lot about unit testing now. We kind of got into integration tests slightly with the templates and the components, whatever, but we need to look at end-to-end tests. Is that right? Yeah. So is that specific? Is there a specific way to do that with Angular as well? Well, again, the CLI kind of bakes it in for you, and it's all set up ready to go with Protractor. Okay. You don't get the same level of code generation, like it's not going to generate you end-to-end tests as you make a new component. Okay. You only get one sample up front, and it usually lives in this folder, and no one touches it, but if you're doing end-to-end tests, you're responsible to grow it out. There's no amazing tooling around it. Got you. So we're going to show you what comes out of the box, and we'll extend it. Okay.