Introduction to AngularJS Unit Testing

Jim Lavin · 96K views · 2013 · 1:05:56

Open on YouTube

Testing, debugging & developer toolsWeb developmenttalkdated

Why Stack Overflow recommends it

Stack Overflow users link it as a step-by-step AngularJS unit testing walkthrough, both in answers to "where do I learn testing" and in questions from people following along who hit setup errors.

Recommended by 1 people across 1 different months, 2014 to 2015.

What it is

A recorded November 2013 DFW Area AngularJS Meetup talk by Jim Lavin on unit testing AngularJS code. He scaffolds a project with Yeoman, then builds a controller, service and directive test-first, writing the unit tests before the code that makes them pass.

What people said

Strong rec Linial · 2014-11 · Stack Overflow · on “Angular JS unit testing tutorials with examples”

First of all, and most IMPORTANT: Unit-testing is similar in all other languages. You have to keep in mind the main features of writing testable code. Note: There is a good Pluralsight video ( Which cost money ) by Misko Hevery on Writing Testable Code). First: Watch this youtube by Vojta Jina - Installing and Starting Karma [LINK] , the person who wrote karma. Second: Watch this 1 Hour tutorial which I highly recommand : Introduction to AngularJS Unit Testing By Jim Levin [this video] After you complete those you should be able to test every piece of code in your Angular Project. Good Luck.

Cites Fortuna · 2014-02 · Stack Overflow · on “AngularJS kickstart with Yeoman - bower_components missing”

I am currently learning AngularJS and the Test Driven Development concept so I was watching the introduction [this video] and now where I want to start the server via "grunt server" it throws an error with something like "bower_components directory not found". I definately installed Bower but the error still occurs. I'm using Windows 7, I hope someone can help me.

Cites Fortuna · 2014-02 · Stack Overflow · on “Yeoman scaffolding: Unable to find local grunt”

I just want to scaffold a simple god damn AngularJS application. But hey... it seems like nothing in the Javascript Developer World is possible without installing thousands of different libraries and whatever you call them. I use Windows 7 and run "yo angular" on my application folder. Everything worked fine until I entered "grunt serve" in my console. And yay there comes the next dubious error message "Unable to find local grunt", although I followed the introduction video [this video] here step by step. But for some reason Windows user or just me are the only person on earth who get the error. Mac users seem to be invincible. Im sorry for this writing style but Im pretty frustrated. I try to le

Cites asdf_enel_hak · 2015-08 · Stack Overflow · on “Defined service method is not called, instead real service's is called”

I am following this video tutorial [this video] and its source is here [LINK] . I am trying to apply this test [LINK] Here is my test describe("InStudentController", function () { beforeEach(module("eucngts")); var inStudentsController; var MyInStudentsService; var $scope; var $q; var deferred; beforeEach(function () { MyInStudentsService = { getInStudents: function () { deferred = $q.defer(); return deferred.promise; } }; }); beforeEach(inject(function ($controller, $rootScope, _$q_) { $q = _$q_; $scope = $rootScope.$new(); inStudentsController = $controller('InStudentsController', { service: MyInStudentsService }); })); it("should request list of inStudents", function () { spyOn(MyInStudentsSer