# Learning Angular: Unit Testing $watch expressions

DevFeed: [Learning Angular: Unit Testing $watch expressions](<https://devfeed.tech/articles/learning-angular-unit-testing-watch-expressions-21230.md>)

Original publisher: [Read original article](<https://juri.dev/blog/2014/11/learning-ng-testing-watch-expressions/>)

Published: 2014-11-25T00:00:00Z

Content type: tutorial

Language: en

Sources: [Juri Strumpflohner](<https://devfeed.tech/sources/juri-strumpflohner.md>)

Topics: [Angular](<https://devfeed.tech/topics/angular.md>), [Unit testing](<https://devfeed.tech/topics/unit-testing.md>), [Testing](<https://devfeed.tech/topics/testing.md>)

Tags: [angular](<https://devfeed.tech/tags/angular.md>), [testing](<https://devfeed.tech/tags/testing.md>), [tests](<https://devfeed.tech/tags/tests.md>), [unit-testing](<https://devfeed.tech/tags/unit-testing.md>)

## AI overview

This tutorial explains how to unit test Angular $watch expressions when using controller-as syntax. It identifies incorrect controller and scope initialization as the cause of undefined values and shows that setting the controller property correctly or calling $digest resolves the tests.

## Source excerpt

Lorem ipsum dolor sit amet