accessing $scope from unit test file when using the vm “ControllerAs” syntax from AngularJS HotTowel
Ah, obvious now…I can access the vm variable through making a reference to the controller that’s created in the test: it(“should assign Dashboard as title”, function () { var vm = controller(“dashboard”, { $scope: scope }); expect(vm.title).toBe(“Dashboard”); });