AngularJS test-driven development: implement the best practices to improve your AngularJS applications using test-driven development 9781784398835, 9781784393823, 1784393827

This book is for developers who want to learn about AngularJS development by applying testing techniques. You are assume

513 60 3MB

English Year 2015

Report DMCA / Copyright

DOWNLOAD FILE

AngularJS test-driven development: implement the best practices to improve your AngularJS applications using test-driven development
 9781784398835, 9781784393823, 1784393827

Table of contents :
Cover
Copyright
Credits
About the Author
About the Reviewers
www.PacktPub.com
Table of Contents
Preface
Chapter 1: Introduction to Test-driven Development
An overview of TDD
Fundamentals of TDD
Measuring success
Breaking down the steps
Measure twice cut once
Diving in
Setting up the test
Creating a development to-do list
Test first
Making it run
Making it better
Testing techniques
Testing with a framework
Testing doubles with Jasmine spies
Stubbing a return value
Testing arguments
Refactoring
Building with a builder
Self-test questions (true/false)
Summary Chapter 2: The Karma WayJavaScript testing tools
Karma
Protractor
JavaScript testing frameworks
Jasmine
Selenium
Mocha
Birth of Karma
The Karma difference
Importance of combining Karma with AngularJS
Installing Karma
Installation prerequisites
Configuring Karma
Customizing Karma's configuration
Confirming Karma's installation and configuration
Common installation/configuration issues
Testing with Karma
Confirming the Karma installation
Using Karma with AngularJS
Getting AngularJS
Bower
Installing AngularJS
Installing Angular mocks
Initializing Karma Testing with AngularJS and KarmaA development to-do list
Testing a list of items
Test first
Assemble, Act, and Assert (3 A's)
Make it run
Make it better
Adding a function to the controller
Test first
Assemble, Act, and Assert (3 A's)
Make it run
Make it better
Self-test questions
Summary
Chapter 3: End-to-end Testing with Protractor
An overview of Protractor
Origins of Protractor
End of life
The birth of Protractor
Life without Protractor
Protractor installation
Installation prerequisites
Installing Protractor
Installing WebDriver for Chrome
Customizing configuration Confirming installation and configurationCommon installation/configuration issues
Hello Protractor
TDD end-to-end
The pre-setup
The setup
Test first
Installing the test web server
Configuring Protractor
Getting down to business
Cleaning up the gaps
Async magic
Loading a page before test execution
Assertion on elements that get loaded in promises
TDD with Protractor
Self-test questions
Summary
Chapter 4: The First Step
Preparing the application's specification
Setting up the project
Setting up the directory
Setting up Protractor
Setting up Karma
Setting up http-server Top-down or bottom-up approachTesting a controller
A simple controller test setup
Initializing the scope
Bring on the comments
Test first
Assemble
Act
Assert
Make it run
Adding the module
Adding the input
Controller
Make it pass
Make it better
Implementing the Submit button
Configuring Karma
Test first
Make it run
Make it better
Back up the test chain
Bind the input
Onwards and upwards
Test first
Assemble
Act
Assert
Make it run
Fixing the unit tests
Make it better
Coupling of the test
Self-test questions
Summary
Chapter 5: Flip Flop
Fundamentals

Polecaj historie