O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Javascript Unit Testing

Video Description

In this JavaScript Unit Testing training course, expert author Mark Ethan Trostler will teach you the theory and practice of JavaScript unit testing. This course is designed for users that already have a basic understanding of JavaScript.

You will start by learning the basics of unit testing, then jump into learning how to code for testability. From there, Mark will teach you about Jasmine, including how to run and select tests, write a custom matcher, and how to extend Jasmine. This video tutorial also covers other JavaScript testing frameworks, such as QUnit and Mocha. Finally, you will learn about automation and continuous integration.

Once you have completed this computer based training course, you will have learned everything you need to know about JavaScript unit testing and automation. Working files are included, allowing you to follow along with the author throughout the lessons.

Table of Contents

  1. Introduction
    1. Types Of Software Testing 00:07:31
    2. The Testing Pyramid 00:06:38
    3. What You Will Learn In This Course 00:04:09
    4. About The Author 00:02:22
    5. How To Access Your Working Files 00:01:15
  2. Unit Testing Basics
    1. Unit Testing Terminology 00:09:46
    2. What A JavaScript Unit Test Looks Like 00:05:42
    3. Writing Your Own Javscript Unit Test 00:04:37
    4. Assertions 00:07:24
    5. The Role Of Code Coverage 00:07:07
    6. How JavaScript Unit Test Is Different 00:06:59
    7. JavaScript Unit Test Flow 00:05:14
    8. Manual Unit Testing 00:06:48
    9. JavaScript Unit Test Frameworks 00:08:04
    10. Running Unit Tests 00:04:02
    11. JavaScript Unit Test Environments 00:07:55
    12. Synchronous And Asynchronous Unit Tests 00:05:47
    13. Introduction Test Driven Development 00:04:37
    14. Test Driven Development In Practice 00:12:33
  3. Coding For Testability
    1. What Is Testable Code? 00:05:27
    2. Cyclomatic Complexity 00:07:56
    3. Fan-In And Fan-Out 00:06:31
    4. Coupling 00:07:14
    5. Inheritance Or Composition? 00:10:07
    6. Code Injection 00:09:22
    7. Using Decorators 00:07:47
    8. Leveraging Abstract Factories 00:06:38
    9. Measuring Complexity 00:09:30
    10. Getting To Testability 00:07:49
  4. Jasmine
    1. Introduction To Jasmine 00:11:02
    2. Jasmine On The Client 00:05:27
    3. Jasmine On The Server 00:07:02
    4. Starting Your First Test 00:07:36
    5. Writing Your First Test 00:11:24
    6. Selecting Tests 00:06:02
    7. Running Tests 00:06:18
    8. Introduction To Basic Matchers 00:08:33
    9. More Basic Matchers 00:08:10
    10. Asymmetric Matchers 00:10:05
    11. Introduction To Custom Matchers 00:06:25
    12. Custom Matcher Error Messages 00:04:33
    13. Custom Matcher Example - toBeVisible 00:08:13
    14. Basic Spying 00:06:24
    15. More Spying 00:07:18
    16. Advanced Spying 00:09:04
    17. Setup And Teardown - Nesting 00:07:50
    18. Setup And Teardown - Variables 00:09:04
    19. Asynchronous Tests 00:06:41
  5. Extending Jasmine
    1. Introduction To is.js 00:04:57
    2. Integration is.js With Jasmine 00:10:51
    3. Jasmine - Matchers And Promises 00:06:57
    4. Introduction To saywhen 00:05:48
    5. saywhen And Captors 00:04:36
    6. Mocking Time 00:05:56
    7. Introduction To Mocking Ajax 00:09:50
    8. Mocking Ajax Responses 00:06:46
    9. Encapsulation Mocked Ajax 00:03:30
    10. Introduction To Jasmine-jQuery Matchers 00:08:20
    11. Introduction To Jasmine-jQuery Fixtures 00:05:18
    12. Using Jasmine-jQuery Fixtures 00:07:16
    13. Jasmine-jQuery Fixtures And The Dom 00:07:12
    14. Testing With Jasmine-jQuery Fixtures 00:07:06
    15. Other Fixture Operations 00:04:41
    16. Event Spies 00:08:13
    17. Introduction To Code Coverage With Istanbul 00:07:05
    18. Manual Code Coverage Generation 00:07:18
  6. Other JavaScript Testing Frameworks
    1. Introduction To QUnit 00:07:51
    2. Using Qunit 00:06:31
    3. More QUnit 00:06:11
    4. Introduction To Mocha 00:06:28
    5. More Mocha 00:06:38
    6. Even More Mocha 00:05:27
    7. Introduction To Tape 00:05:46
    8. Using Tape 00:06:43
    9. ESLint 00:08:16
    10. Sinon.JS And Spies 00:09:11
    11. Sinon.JS Stubs 00:08:43
    12. Sinon.JS Mocks 00:09:15
    13. Sinon.JS Mocking Ajax 00:07:28
    14. Introduction To Istanbul 00:06:35
    15. Using Istanbul 00:08:23
    16. Introduction To Selenium WebDriver 00:06:57
    17. Using WebDriver 00:06:12
    18. WebDriver And GhostDriver And PhantomJS 00:04:58
  7. Headless And Scriptable Browsers
    1. Introduction To PhantomJS 00:07:08
    2. Using PhantomJS With Jasmine 00:07:00
    3. Scripting PhantomJS And Waits 00:03:54
    4. Introduction To SlimerJS 00:06:20
    5. Using SlimerJS 00:06:05
    6. Introduction To CasperJS 00:06:00
    7. CasperJS Test API 00:07:00
    8. Introduction To Xvfb 00:06:31
    9. Using Xvfb 00:04:58
  8. Automation
    1. The Role Of Automation 00:07:40
    2. How To Automate 00:09:55
    3. Introduction To Karma 00:09:00
    4. Using Karma 00:07:24
    5. Karma In The Real World - Part 1 00:08:30
    6. Karma In The Real World - Part 2 00:05:51
    7. Karma In The Real World - Part 3 00:06:47
    8. Karma And Code Coverage 00:07:02
    9. Grunt 00:06:20
    10. Gulp 00:06:22
    11. Bower 00:06:06
    12. Yeoman 00:07:24
    13. Introduction To npm - package.json And semver 00:06:52
    14. npm Dependencies And Scripts 00:06:16
    15. npm Configuration Variables 00:04:38
    16. npm And Versions And Shrinkwrap 00:07:56
  9. Continuous Integration
    1. What Is Continuous Integration? 00:06:06
    2. Getting Started With Jenkins 00:06:16
    3. Jenkins Project Setup 00:04:30
    4. Jenkins Capturing Test Output 00:06:57
    5. Jenkins And Checkstyle 00:04:22
    6. Jenkins And Code Coverage 00:07:10
    7. Jenkins And Gulp 00:06:56
    8. Using GitHub 00:04:48
    9. Introduction To Travis CI 00:05:37
    10. Preparing Your GitHub Repo For Travis CI Integration 00:08:25
    11. Travis CI And Headless Testing With Firefox And Xvfb 00:07:58
    12. Travis CI Wrap-Up 00:06:11
  10. Wrap-Up
    1. What We Have Learned 00:11:53