Back to All Events

Alisa Duncan

  • Holiday Inn Ghent Expo (map)

Angular component test harnesses FTW

Description

Do you want component unit tests that are easier to write and maintain - tests that don’t have to always query the template? This is possible when you use Angular CDK's test harnesses.

In this talk, we'll cover different types of testing methods, what test harnesses are, using Angular Material component test harnesses for immediate results, and how you can extend the CDK `ComponentHarness` to create custom component test harnesses. With the power of testing harnesses, you'll be able to write winning tests.

Key takeaways

  1. Use test harnesses to write tests that are more robust, and easier to read, write, and maintain when using Angular Material components

  2. Update existing tests to use Material component test harnesses as part of MDC updates

  3. Leverage CDK testing framework to create test harnesses for your custom components

  4. Always test your custom component test harness interactions

  5. Minimize component complexity for better architecture practices and simplify testing

About Alisa

Alisa Duncan is a Senior Developer Advocate at Okta, a full-stack developer, and a community builder who loves the thrill of learning new things. She is a Google Developer Expert in Angular, a Women Techmaker Ambassador, co-organizes AngularKC meetup, is on the core team of ngGirls, and helps lead an organization that teaches women web development basics. When not coding or volunteering, she enjoys cooking, watching K-Dramas, and drinking a glass of wine.

Learn more about Alisa at:

  1. https://alisaduncan.dev/

  2. https://twitter.com/AlisaDuncan

  3. https://www.linkedin.com/in/jalisaduncan/

  4. https://github.com/alisaduncan

  5. https://mastodon.world/@AlisaDuncan

Earlier Event: March 24
Simona Cotin
Later Event: March 24
Stefan Baumgartner