SlideShare a Scribd company logo
AngularJS
testing
strategies
Nate Peterson
@njpetersonPa
What’s not in this talk
What’s this talk about
Why do we care about
testing?
Tests help us fail fast
Tests give us confidence
Tests help us understand what
we’re doing and where we’re going
JavaScript is a dynamically typed
language with almost nohelp from
compiler
“One of the fundamental reasons
for choosing Angular is cited as that
it is built with testing in
mind.”
AngularJS Testing Strategies
AngularJS Testing Strategies
function MyController() {
var dep1 = new Dep1();
var dep2 = new Dep2();
//do something with dep1 and dep2
...
}
someModule.controller('MyController',
['$scope', 'dep1', 'dep2', function($scope, dep1, dep2) {
...
$scope.aMethod = function() {
...
}
...
}]);
The Angular way
AngularJS Testing Strategies
function AddCtrl() {
var operand1 = $(#operand1);
var operand2 = $(#operand2);
var result = $(#result);
this.add = function() {
result = operand1 + operand2;
}
}
var operand1 = $('<input type="text" id="operand1" />');
var operand2 = $('<input type="text" id="operand1" />');
var result = $('<input type="text" id= "result" />');
var span = $('<span>');
$('body').html('<div class="ex1">')
.find('div')
.append(operand1)
.append(operand2)
.append(result);
var ac = new AddCtrl();
operand1.val('1');
operand2.val('1');
ac.add();
expect(result.val()).toEqual('2');
$('body').empty();
Controllers - The Angular way
function AddCtrl($scope) {
$scope.Calc = function() {
$scope.result = $scope.operand1 + $scope.operand2;
}
}
Controllers - The Angular way
var $scope = {};
var ctrl = $controller(‘AddCtrl’), {$scope: $scope };
$scope.operand1 = 1;
$scope.operand2 = 1;
$scope.calc();
expect($scope.result).toEqual(2);
Two types of testing
that
compliment each other
unit testing
and
e2e testing
How much reality do you need
in your tests?
Knowing what to test is just as
important as how to test
Test all the
things
is not a strategy
“I get paid for code that works,
not for tests, so my philosophy is
to test as little as possible to reach
a given level of confidence…”
-- Kent Beck
Focus on behaviors
rather than implementation details
Example – Testing a simple controller
app.controller('AddCtrl', function($scope) {
$scope.calc = function() {
$scope.result = $scope.operand1 + $scope.operand2;
}
});
app.controller('AddCtrl', function($scope) {
$scope.calc = function() {
$scope.result = $scope.operand1 + $scope.operand2;
}
});
describe('adding 1 + 1', function() {
beforeEach(module('myApp'));
});
app.controller('AddCtrl', function($scope) {
$scope.calc = function() {
$scope.result = $scope.operand1 + $scope.operand2;
}
});
describe('adding 1 + 1', function() {
beforeEach(module('myApp'));
var ctrl, scope;
beforeEach(inject(function($controller, $rootScope) {
scope = $rootScope.$new();
ctrl = $controller('AddCtrl', { $scope: scope });
}));
});
app.controller('AddCtrl', function($scope) {
$scope.calc = function() {
$scope.result = $scope.operand1 + $scope.operand2;
}
});
describe('adding 1 + 1', function() {
beforeEach(module('myApp'));
var ctrl, scope;
beforeEach(inject(function($controller, $rootScope) {
scope = $rootScope.$new();
ctrl = $controller('AddCtrl', { $scope: scope });
}));
it('should equal 2', function() {
scope.operand1 = 1;
scope.operand2 = 1;
scope.calc();
expect(scope.result).toEqual(2);
})
});
Example – mocking $http
var app = angular.module('myApp', []);
app.controller('MoviesController', function($scope, $http) {
$http.get("/api/movies")
.then(function (result) {
$scope.movies = result.data;
});
});
describe("myApp", function () {
beforeEach(module('myApp'));
describe("MoviesController", function () {
var scope, httpBackend, http, controller;
});
describe("myApp", function () {
beforeEach(module('myApp'));
describe("MoviesController", function () {
var scope, httpBackend, http, controller;
beforeEach(inject(function ($rootScope, $controller,
$httpBackend, $http) {
scope = $rootScope.$new();
httpBackend = $httpBackend;
http = $http;
controller = $controller;
}));
});
describe("myApp", function () {
beforeEach(module('myApp'));
describe("MoviesController", function () {
var scope, httpBackend, http, controller;
beforeEach(inject(function ($rootScope, $controller,
$httpBackend, $http) {
scope = $rootScope.$new();
httpBackend = $httpBackend;
http = $http;
controller = $controller;
httpBackend.when("GET", "/api/movies")
.respond([{}, {}, {}]);
}));
});
});
describe("myApp", function () {
beforeEach(module('myApp'));
describe("MoviesController", function () {
var scope, httpBackend, http, controller;
beforeEach(inject(function ($rootScope, $controller,
$httpBackend, $http) {
scope = $rootScope.$new();
httpBackend = $httpBackend;
http = $http;
controller = $controller;
httpBackend.when("GET", "/api/movies")
.respond([{}, {}, {}]);
}));
it('should GET movies', function () {
httpBackend.expectGET('/api/movies');
controller('MoviesController', {
$scope: scope, $http: http
});
});
});
});
describe("myApp", function () {
beforeEach(module('myApp'));
describe("MoviesController", function () {
var scope, httpBackend, http, controller;
beforeEach(inject(function ($rootScope, $controller,
$httpBackend, $http) {
scope = $rootScope.$new();
httpBackend = $httpBackend;
http = $http;
controller = $controller;
httpBackend.when("GET", "/api/movies")
.respond([{}, {}, {}]);
}));
it('should GET movies', function () {
httpBackend.expectGET('/api/movies');
controller('MoviesController', {
$scope: scope, $http: http
});
httpBackend.flush();
});
});
});
Example - mocking services
angular.module('myApp', [])
.factory('greeter', function () {
return 'Hello';
})
.factory('worldGreeter', function (greeter) {
return greeter + ' World';
});
angular.module('myApp', [])
.factory('greeter', function () {
return 'Hello';
})
.factory('worldGreeter', function (greeter) {
return greeter + ' World';
});
describe('worldGreeter', function () {
beforeEach(inject(function (_worldGreeter_) {
worldGreeter = _worldGreeter_;
}));
});
angular.module('myApp', [])
.factory('greeter', function () {
return 'Hello';
})
.factory('worldGreeter', function (greeter) {
return greeter + ' World';
});
describe('worldGreeter', function () {
beforeEach(inject(function (_worldGreeter_) {
worldGreeter = _worldGreeter_;
}));
it('should work with mocked greeter', function () {
expect(worldGreeter).toEqual('WAT World');
});
});
angular.module('myApp', [])
.factory('greeter', function () {
return 'Hello';
})
.factory('worldGreeter', function (greeter) {
return greeter + ' World';
});
describe('worldGreeter', function () {
beforeEach(module('myApp', function($provide) {
$provide.value('greeter', 'WAT');
}));
beforeEach(inject(function (_worldGreeter_) {
worldGreeter = _worldGreeter_;
}));
it('should work with mocked greeter', function () {
expect(worldGreeter).toEqual('WAT World');
});
});
angular.module('myApp', [])
.factory('greeter', function () {
return 'Hello';
})
.factory('worldGreeter', function (greeter) {
return greeter + ' World';
});
describe('worldGreeter', function () {
beforeEach(module('myApp', function ($provide) {
$provide.decorator('greeter', function ($delegate) {
return 'WAT';
});
}));
beforeEach(inject(function (_worldGreeter_) {
worldGreeter = _worldGreeter_;
}));
it('should work with mocked greeter', function () {
expect(worldGreeter).toEqual('WAT World');
});
});
Example – testing a directive
var app = angular.module('myApp', []);
app.directive('simpleDirective', function (){
return {
restrict: 'E',
template: '<div>{{value}}</div>',
scope: {
value: '='
}
};
});
describe('Testing simpleDirective', function() {
var scope, elem, directive, compiled, html;
beforeEach(function () {
module('myApp‘);
});
});
it('Should set the text of the element to whatever was passed.',
function() {
});
});
describe('Testing simpleDirective', function() {
var scope, elem, directive, compiled, html;
beforeEach(function (){
module('myApp');
html = '<simple-directive value="abc"></simple-directive>';
});
it('Should set the text of the element to whatever was passed.',
function() {
});
});
describe('Testing simpleDirective', function() {
var scope, elem, directive, compiled, html;
beforeEach(function (){
module('myApp');
html = ‘<simple-directive value="abc"></simple-directive>';
inject(function($compile, $rootScope) {
scope = $rootScope.$new();
elem = angular.element(html);
compiled = $compile(elem);
compiled(scope);
});
});
it('Should set the text of the element to whatever was passed.',
function() {
});
});
 
describe('Testing  simpleDirective', function() {  
 var scope, elem, directive, compiled, html;        
 beforeEach(function (){    
    module('myApp');        
    html = ‘<simple-directive value="abc"></simple-directive>';       
   
    inject(function($compile, $rootScope) {            
       scope = $rootScope.$new();      
       elem = angular.element(html);      
       compiled = $compile(elem);      
       compiled(scope);    
    });  
 });  
 it('Should set the text of the element to whatever was passed.', 
   function() {    
    expect(elem.text()).toBe('blah');
 });
});
 
describe('Testing  simpleDirective', function() {  
 var scope, elem, directive, compiled, html;        
 beforeEach(function (){    
    module('myApp');        
    html = ‘<simple-directive value="abc"></simple-directive>';       
   
    inject(function($compile, $rootScope) {            
       scope = $rootScope.$new();      
       elem = angular.element(html);      
       compiled = $compile(elem);      
       compiled(scope);    
    });  
 });  
 it('Should set the text of the element to whatever was passed.', 
   function() {    
     scope.abc = 'blah';
scope.$digest();
    expect(elem.text()).toBe('blah');  
 });
});
e2e testing / protractor
<body>    
   <h1>Sample</h1>    
   <div>
      Two Way Data Binding Sample      
      <br/><br/>      
      <input type="text" ng-model="name" />      
      <span ng-show="name"><h4>Hello {{name}}</h4></span>
   </div>  
</body>
describe(demo page', function() {
it('should greet the user', function() {
browser.get('[some route]');
});
});
<body>    
   <h1>Sample</h1>    
   <div>
      Two Way Data Binding Sample      
      <br/><br/>      
      <input type="text" ng-model="name" />      
      <span ng-show="name"><h4>Hello {{name}}</h4></span>
   </div>  
</body>
describe(demo page', function() {
it('should greet the user', function() {
browser.get('[some route]');
element(by.model('name')).sendKeys('Nate Peterson');
});
});
<body>    
   <h1>Sample</h1>    
   <div>
      Two Way Data Binding Sample      
      <br/><br/>      
      <input type="text" ng-model="name" />      
      <span ng-show="name"><h4>Hello {{name}}</h4></span>
   </div>  
</body>
describe(demo page', function() {
it('should greet the user', function() {
browser.get('[some route]');
element(by.model('name')).sendKeys('Nate Peterson');
var greeting = element(by.binding('name'));
});
});
<body>    
   <h1>Sample</h1>    
   <div>
      Two Way Data Binding Sample      
      <br/><br/>      
      <input type="text" ng-model="name" />      
      <span ng-show="name"><h4>Hello {{name}}</h4></span>
   </div>  
</body>
describe(demo page', function() {
it('should greet the user', function() {
browser.get('[some route]');
element(by.model('name')).sendKeys('Nate Peterson');
var greeting = element(by.binding('name'));
expect(greeting.getText()).toEqual('Hello 'Nate
Peterson');
});
});
<body>    
   <h1>Sample</h1>    
   <div>
      Two Way Data Binding Sample      
      <br/><br/>      
      <input type="text" ng-model="name" />      
      <span ng-show="name"><h4>Hello {{name}}</h4></span>
   </div>  
</body>
What’s worked well so far
Use of a Mock API for e2e tests
What’s been hard
Bloated controllers
that lead to
bloated specs
Complicated unit test setup
Hard to read tests
Questions?
AngularJS
testing
strategies
Nate Peterson
@njpetersonPa
Ad

Recommended

Angular testing
Angular testing
Raissa Ferreira
 
Angular JS Unit Testing - Overview
Angular JS Unit Testing - Overview
Thirumal Sakthivel
 
Intro to Unit Testing in AngularJS
Intro to Unit Testing in AngularJS
Jim Lynch
 
AngularJS Unit Testing w/Karma and Jasmine
AngularJS Unit Testing w/Karma and Jasmine
foxp2code
 
Unit Testing Front End JavaScript
Unit Testing Front End JavaScript
FITC
 
Stop Making Excuses and Start Testing Your JavaScript
Stop Making Excuses and Start Testing Your JavaScript
Ryan Anklam
 
Qunit Java script Un
Qunit Java script Un
akanksha arora
 
Advanced Jasmine - Front-End JavaScript Unit Testing
Advanced Jasmine - Front-End JavaScript Unit Testing
Lars Thorup
 
Unit testing in JavaScript with Jasmine and Karma
Unit testing in JavaScript with Jasmine and Karma
Andrey Kolodnitsky
 
Testing Javascript with Jasmine
Testing Javascript with Jasmine
Tim Tyrrell
 
Jasmine BDD for Javascript
Jasmine BDD for Javascript
Luis Alfredo Porras Páez
 
Test-Driven Development of AngularJS Applications
Test-Driven Development of AngularJS Applications
FITC
 
Java script advance-auroskills (2)
Java script advance-auroskills (2)
BoneyGawande
 
AngularJS Unit Testing
AngularJS Unit Testing
Prince Norin
 
Unit Testing Express and Koa Middleware in ES2015
Unit Testing Express and Koa Middleware in ES2015
Morris Singer
 
Describe's Full of It's
Describe's Full of It's
Jim Lynch
 
Unit testing JavaScript using Mocha and Node
Unit testing JavaScript using Mocha and Node
Josh Mock
 
Unit Testing JavaScript Applications
Unit Testing JavaScript Applications
Ynon Perek
 
Angular Unit Testing
Angular Unit Testing
Avi Engelshtein
 
Workshop 5: JavaScript testing
Workshop 5: JavaScript testing
Visual Engineering
 
Unit testing with mocha
Unit testing with mocha
Revath S Kumar
 
JavaScript Unit Testing with Jasmine
JavaScript Unit Testing with Jasmine
Raimonds Simanovskis
 
JavaScript TDD with Jasmine and Karma
JavaScript TDD with Jasmine and Karma
Christopher Bartling
 
JavaScript Test-Driven Development with Jasmine 2.0 and Karma
JavaScript Test-Driven Development with Jasmine 2.0 and Karma
Christopher Bartling
 
Testing in AngularJS
Testing in AngularJS
Peter Drinnan
 
Jasmine - why JS tests don't smell fishy
Jasmine - why JS tests don't smell fishy
Igor Napierala
 
JavaScript Functions
JavaScript Functions
Colin DeCarlo
 
Understanding JavaScript Testing
Understanding JavaScript Testing
Kissy Team
 
TDD, unit testing and java script testing frameworks workshop
TDD, unit testing and java script testing frameworks workshop
Sikandar Ahmed
 
Javascript Tests with Jasmine for Front-end Devs
Javascript Tests with Jasmine for Front-end Devs
Chris Powers
 

More Related Content

What's hot (20)

Unit testing in JavaScript with Jasmine and Karma
Unit testing in JavaScript with Jasmine and Karma
Andrey Kolodnitsky
 
Testing Javascript with Jasmine
Testing Javascript with Jasmine
Tim Tyrrell
 
Jasmine BDD for Javascript
Jasmine BDD for Javascript
Luis Alfredo Porras Páez
 
Test-Driven Development of AngularJS Applications
Test-Driven Development of AngularJS Applications
FITC
 
Java script advance-auroskills (2)
Java script advance-auroskills (2)
BoneyGawande
 
AngularJS Unit Testing
AngularJS Unit Testing
Prince Norin
 
Unit Testing Express and Koa Middleware in ES2015
Unit Testing Express and Koa Middleware in ES2015
Morris Singer
 
Describe's Full of It's
Describe's Full of It's
Jim Lynch
 
Unit testing JavaScript using Mocha and Node
Unit testing JavaScript using Mocha and Node
Josh Mock
 
Unit Testing JavaScript Applications
Unit Testing JavaScript Applications
Ynon Perek
 
Angular Unit Testing
Angular Unit Testing
Avi Engelshtein
 
Workshop 5: JavaScript testing
Workshop 5: JavaScript testing
Visual Engineering
 
Unit testing with mocha
Unit testing with mocha
Revath S Kumar
 
JavaScript Unit Testing with Jasmine
JavaScript Unit Testing with Jasmine
Raimonds Simanovskis
 
JavaScript TDD with Jasmine and Karma
JavaScript TDD with Jasmine and Karma
Christopher Bartling
 
JavaScript Test-Driven Development with Jasmine 2.0 and Karma
JavaScript Test-Driven Development with Jasmine 2.0 and Karma
Christopher Bartling
 
Testing in AngularJS
Testing in AngularJS
Peter Drinnan
 
Jasmine - why JS tests don't smell fishy
Jasmine - why JS tests don't smell fishy
Igor Napierala
 
JavaScript Functions
JavaScript Functions
Colin DeCarlo
 
Understanding JavaScript Testing
Understanding JavaScript Testing
Kissy Team
 
Unit testing in JavaScript with Jasmine and Karma
Unit testing in JavaScript with Jasmine and Karma
Andrey Kolodnitsky
 
Testing Javascript with Jasmine
Testing Javascript with Jasmine
Tim Tyrrell
 
Test-Driven Development of AngularJS Applications
Test-Driven Development of AngularJS Applications
FITC
 
Java script advance-auroskills (2)
Java script advance-auroskills (2)
BoneyGawande
 
AngularJS Unit Testing
AngularJS Unit Testing
Prince Norin
 
Unit Testing Express and Koa Middleware in ES2015
Unit Testing Express and Koa Middleware in ES2015
Morris Singer
 
Describe's Full of It's
Describe's Full of It's
Jim Lynch
 
Unit testing JavaScript using Mocha and Node
Unit testing JavaScript using Mocha and Node
Josh Mock
 
Unit Testing JavaScript Applications
Unit Testing JavaScript Applications
Ynon Perek
 
Workshop 5: JavaScript testing
Workshop 5: JavaScript testing
Visual Engineering
 
Unit testing with mocha
Unit testing with mocha
Revath S Kumar
 
JavaScript Unit Testing with Jasmine
JavaScript Unit Testing with Jasmine
Raimonds Simanovskis
 
JavaScript TDD with Jasmine and Karma
JavaScript TDD with Jasmine and Karma
Christopher Bartling
 
JavaScript Test-Driven Development with Jasmine 2.0 and Karma
JavaScript Test-Driven Development with Jasmine 2.0 and Karma
Christopher Bartling
 
Testing in AngularJS
Testing in AngularJS
Peter Drinnan
 
Jasmine - why JS tests don't smell fishy
Jasmine - why JS tests don't smell fishy
Igor Napierala
 
JavaScript Functions
JavaScript Functions
Colin DeCarlo
 
Understanding JavaScript Testing
Understanding JavaScript Testing
Kissy Team
 

Viewers also liked (15)

TDD, unit testing and java script testing frameworks workshop
TDD, unit testing and java script testing frameworks workshop
Sikandar Ahmed
 
Javascript Tests with Jasmine for Front-end Devs
Javascript Tests with Jasmine for Front-end Devs
Chris Powers
 
EasyTest Test Automation Tool Introduction
EasyTest Test Automation Tool Introduction
Zhu Zhong
 
Testing angular js
Testing angular js
galan83
 
Slaven tomac unit testing in angular js
Slaven tomac unit testing in angular js
Slaven Tomac
 
Test-Driven Development with TypeScript+Jasmine+AngularJS
Test-Driven Development with TypeScript+Jasmine+AngularJS
SmartOrg
 
AngularJS Testing
AngularJS Testing
Ahmed Elmehri
 
Angular 2 - What's new and what's different
Angular 2 - What's new and what's different
Priscila Negreiros
 
AngularJS Unit Test
AngularJS Unit Test
Chiew Carol
 
Unit testing JavaScript: Jasmine & karma intro
Unit testing JavaScript: Jasmine & karma intro
Maurice De Beijer [MVP]
 
TDD Basics with Angular.js and Jasmine
TDD Basics with Angular.js and Jasmine
Luis Sánchez Castellanos
 
Intro to testing Javascript with jasmine
Intro to testing Javascript with jasmine
Timothy Oxley
 
Angularjs - Unit testing introduction
Angularjs - Unit testing introduction
Nir Kaufman
 
Automated Testing With Jasmine, PhantomJS and Jenkins
Automated Testing With Jasmine, PhantomJS and Jenkins
Work at Play
 
Jasmine
Jasmine
Chris Powers
 
TDD, unit testing and java script testing frameworks workshop
TDD, unit testing and java script testing frameworks workshop
Sikandar Ahmed
 
Javascript Tests with Jasmine for Front-end Devs
Javascript Tests with Jasmine for Front-end Devs
Chris Powers
 
EasyTest Test Automation Tool Introduction
EasyTest Test Automation Tool Introduction
Zhu Zhong
 
Testing angular js
Testing angular js
galan83
 
Slaven tomac unit testing in angular js
Slaven tomac unit testing in angular js
Slaven Tomac
 
Test-Driven Development with TypeScript+Jasmine+AngularJS
Test-Driven Development with TypeScript+Jasmine+AngularJS
SmartOrg
 
Angular 2 - What's new and what's different
Angular 2 - What's new and what's different
Priscila Negreiros
 
AngularJS Unit Test
AngularJS Unit Test
Chiew Carol
 
Unit testing JavaScript: Jasmine & karma intro
Unit testing JavaScript: Jasmine & karma intro
Maurice De Beijer [MVP]
 
Intro to testing Javascript with jasmine
Intro to testing Javascript with jasmine
Timothy Oxley
 
Angularjs - Unit testing introduction
Angularjs - Unit testing introduction
Nir Kaufman
 
Automated Testing With Jasmine, PhantomJS and Jenkins
Automated Testing With Jasmine, PhantomJS and Jenkins
Work at Play
 
Ad

Similar to AngularJS Testing Strategies (20)

How Testability Inspires AngularJS Design / Ran Mizrahi
How Testability Inspires AngularJS Design / Ran Mizrahi
Ran Mizrahi
 
Angularjs Test Driven Development (TDD)
Angularjs Test Driven Development (TDD)
Anis Bouhachem Djer
 
Workshop 14: AngularJS Parte III
Workshop 14: AngularJS Parte III
Visual Engineering
 
Ultimate Introduction To AngularJS
Ultimate Introduction To AngularJS
Jacopo Nardiello
 
Testing AngularJS
Testing AngularJS
Jacopo Nardiello
 
JavaCro'14 - Unit testing in AngularJS – Slaven Tomac
JavaCro'14 - Unit testing in AngularJS – Slaven Tomac
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
AngularJS.part1
AngularJS.part1
Andrey Kolodnitsky
 
Javascript tdd byandreapaciolla
Javascript tdd byandreapaciolla
Andrea Paciolla
 
AngularJS in practice
AngularJS in practice
Eugene Fidelin
 
An Introduction To Testing In AngularJS Applications
An Introduction To Testing In AngularJS Applications
Rohan Chandane
 
Angular Tutorial Freshers and Experienced
Angular Tutorial Freshers and Experienced
rajkamaltibacademy
 
An Implementation Tour to AngularJS
An Implementation Tour to AngularJS
rahulmonikasharma
 
Introduction to AngularJs
Introduction to AngularJs
murtazahaveliwala
 
Front end development with Angular JS
Front end development with Angular JS
Bipin
 
angularJs Workshop
angularJs Workshop
Ran Wahle
 
Angular Presentation
Angular Presentation
Adam Moore
 
Angular Workshop_Sarajevo2
Angular Workshop_Sarajevo2
Christoffer Noring
 
AngularJs Crash Course
AngularJs Crash Course
Keith Bloomfield
 
Hands on AngularJS
Hands on AngularJS
Thomas Fankhauser
 
Angular js introduction
Angular js introduction
Hsiu Shan
 
How Testability Inspires AngularJS Design / Ran Mizrahi
How Testability Inspires AngularJS Design / Ran Mizrahi
Ran Mizrahi
 
Angularjs Test Driven Development (TDD)
Angularjs Test Driven Development (TDD)
Anis Bouhachem Djer
 
Workshop 14: AngularJS Parte III
Workshop 14: AngularJS Parte III
Visual Engineering
 
Ultimate Introduction To AngularJS
Ultimate Introduction To AngularJS
Jacopo Nardiello
 
Javascript tdd byandreapaciolla
Javascript tdd byandreapaciolla
Andrea Paciolla
 
An Introduction To Testing In AngularJS Applications
An Introduction To Testing In AngularJS Applications
Rohan Chandane
 
Angular Tutorial Freshers and Experienced
Angular Tutorial Freshers and Experienced
rajkamaltibacademy
 
An Implementation Tour to AngularJS
An Implementation Tour to AngularJS
rahulmonikasharma
 
Front end development with Angular JS
Front end development with Angular JS
Bipin
 
angularJs Workshop
angularJs Workshop
Ran Wahle
 
Angular Presentation
Angular Presentation
Adam Moore
 
Angular js introduction
Angular js introduction
Hsiu Shan
 
Ad

Recently uploaded (20)

ERP Systems in the UAE: Driving Business Transformation with Smart Solutions
ERP Systems in the UAE: Driving Business Transformation with Smart Solutions
dheeodoo
 
Humans vs AI Call Agents - Qcall.ai's Special Report
Humans vs AI Call Agents - Qcall.ai's Special Report
Udit Goenka
 
Streamlining CI/CD with FME Flow: A Practical Guide
Streamlining CI/CD with FME Flow: A Practical Guide
Safe Software
 
IDM Crack with Internet Download Manager 6.42 Build 41 [Latest 2025]
IDM Crack with Internet Download Manager 6.42 Build 41 [Latest 2025]
pcprocore
 
Sysinfo OST to PST Converter Infographic
Sysinfo OST to PST Converter Infographic
SysInfo Tools
 
University Campus Navigation for All - Peak of Data & AI
University Campus Navigation for All - Peak of Data & AI
Safe Software
 
Key Challenges in Troubleshooting Customer On-Premise Applications
Key Challenges in Troubleshooting Customer On-Premise Applications
Tier1 app
 
MOVIE RECOMMENDATION SYSTEM, UDUMULA GOPI REDDY, Y24MC13085.pptx
MOVIE RECOMMENDATION SYSTEM, UDUMULA GOPI REDDY, Y24MC13085.pptx
Maharshi Mallela
 
CodeCleaner: Mitigating Data Contamination for LLM Benchmarking
CodeCleaner: Mitigating Data Contamination for LLM Benchmarking
arabelatso
 
Best AI-Powered Wearable Tech for Remote Health Monitoring in 2025
Best AI-Powered Wearable Tech for Remote Health Monitoring in 2025
SEOLIFT - SEO Company London
 
Best MLM Compensation Plans for Network Marketing Success in 2025
Best MLM Compensation Plans for Network Marketing Success in 2025
LETSCMS Pvt. Ltd.
 
Zoho Creator Solution for EI by Elsner Technologies.docx
Zoho Creator Solution for EI by Elsner Technologies.docx
Elsner Technologies Pvt. Ltd.
 
Canva Pro Crack Free Download 2025-FREE LATEST
Canva Pro Crack Free Download 2025-FREE LATEST
grete1122g
 
Digital Transformation: Automating the Placement of Medical Interns
Digital Transformation: Automating the Placement of Medical Interns
Safe Software
 
Best Practice for LLM Serving in the Cloud
Best Practice for LLM Serving in the Cloud
Alluxio, Inc.
 
Folding Cheat Sheet # 9 - List Unfolding 𝑢𝑛𝑓𝑜𝑙𝑑 as the Computational Dual of ...
Folding Cheat Sheet # 9 - List Unfolding 𝑢𝑛𝑓𝑜𝑙𝑑 as the Computational Dual of ...
Philip Schwarz
 
Advance Doctor Appointment Booking App With Online Payment
Advance Doctor Appointment Booking App With Online Payment
AxisTechnolabs
 
Complete WordPress Programming Guidance Book
Complete WordPress Programming Guidance Book
Shabista Imam
 
Simplify Task, Team, and Project Management with Orangescrum Work
Simplify Task, Team, and Project Management with Orangescrum Work
Orangescrum
 
arctitecture application system design os dsa
arctitecture application system design os dsa
za241967
 
ERP Systems in the UAE: Driving Business Transformation with Smart Solutions
ERP Systems in the UAE: Driving Business Transformation with Smart Solutions
dheeodoo
 
Humans vs AI Call Agents - Qcall.ai's Special Report
Humans vs AI Call Agents - Qcall.ai's Special Report
Udit Goenka
 
Streamlining CI/CD with FME Flow: A Practical Guide
Streamlining CI/CD with FME Flow: A Practical Guide
Safe Software
 
IDM Crack with Internet Download Manager 6.42 Build 41 [Latest 2025]
IDM Crack with Internet Download Manager 6.42 Build 41 [Latest 2025]
pcprocore
 
Sysinfo OST to PST Converter Infographic
Sysinfo OST to PST Converter Infographic
SysInfo Tools
 
University Campus Navigation for All - Peak of Data & AI
University Campus Navigation for All - Peak of Data & AI
Safe Software
 
Key Challenges in Troubleshooting Customer On-Premise Applications
Key Challenges in Troubleshooting Customer On-Premise Applications
Tier1 app
 
MOVIE RECOMMENDATION SYSTEM, UDUMULA GOPI REDDY, Y24MC13085.pptx
MOVIE RECOMMENDATION SYSTEM, UDUMULA GOPI REDDY, Y24MC13085.pptx
Maharshi Mallela
 
CodeCleaner: Mitigating Data Contamination for LLM Benchmarking
CodeCleaner: Mitigating Data Contamination for LLM Benchmarking
arabelatso
 
Best AI-Powered Wearable Tech for Remote Health Monitoring in 2025
Best AI-Powered Wearable Tech for Remote Health Monitoring in 2025
SEOLIFT - SEO Company London
 
Best MLM Compensation Plans for Network Marketing Success in 2025
Best MLM Compensation Plans for Network Marketing Success in 2025
LETSCMS Pvt. Ltd.
 
Zoho Creator Solution for EI by Elsner Technologies.docx
Zoho Creator Solution for EI by Elsner Technologies.docx
Elsner Technologies Pvt. Ltd.
 
Canva Pro Crack Free Download 2025-FREE LATEST
Canva Pro Crack Free Download 2025-FREE LATEST
grete1122g
 
Digital Transformation: Automating the Placement of Medical Interns
Digital Transformation: Automating the Placement of Medical Interns
Safe Software
 
Best Practice for LLM Serving in the Cloud
Best Practice for LLM Serving in the Cloud
Alluxio, Inc.
 
Folding Cheat Sheet # 9 - List Unfolding 𝑢𝑛𝑓𝑜𝑙𝑑 as the Computational Dual of ...
Folding Cheat Sheet # 9 - List Unfolding 𝑢𝑛𝑓𝑜𝑙𝑑 as the Computational Dual of ...
Philip Schwarz
 
Advance Doctor Appointment Booking App With Online Payment
Advance Doctor Appointment Booking App With Online Payment
AxisTechnolabs
 
Complete WordPress Programming Guidance Book
Complete WordPress Programming Guidance Book
Shabista Imam
 
Simplify Task, Team, and Project Management with Orangescrum Work
Simplify Task, Team, and Project Management with Orangescrum Work
Orangescrum
 
arctitecture application system design os dsa
arctitecture application system design os dsa
za241967
 

AngularJS Testing Strategies

Editor's Notes

  • #3: TDD (TDD is dead) – could be a whole talk on its own Grunt / Karma – though they do provide great value
  • #4: Unit / e2e testing Strategies for testing Lessons learned Code examples
  • #5: Strategic reasons Helps us fail fast Safety net – confidence Helps us understand Tactical reasons Dynamically typed language with almost no help from compiler
  • #6: Strategic reasons Helps us fail fast Safety net – confidence Helps us understand Tactical reasons Dynamically typed language with almost no help from compiler
  • #7: Strategic reasons Helps us fail fast Safety net – confidence Helps us understand Tactical reasons Dynamically typed language with almost no help from compiler
  • #8: Strategic reasons Helps us fail fast Safety net – confidence Helps us understand Tactical reasons Dynamically typed language with almost no help from compiler
  • #9: Javascript can be hard
  • #10: What does this mean? - Separation concerns
  • #11: Need a new image this is terrible
  • #12: Pattern IOC
  • #13: Show something where dependencies are not injected
  • #14: DI in angular
  • #15: That the controller doesn’t need the dom
  • #16: Something that might be written in jquery
  • #17: Something that we might write to test that. Lacks readability and hard to understand.
  • #19: Maybe mention filters and directives Format expressions
  • #21: What do you use it for… Why would you use it… How do you use it? Behaviors vs. correctness brittleness
  • #22: Justin Searls
  • #24: Tests what’s important
  • #56: expect(greeting.getText()).toEqual(&amp;apos;Hello &amp;apos;Nate Peterson&amp;apos;);