Software Development
Unit Testing in JavaScript
Unit Testing in JavaScript: Exploring & Configuring the Mocha Testing Framework
Unit Testing in JavaScript: Mocha & Chai
Unit Testing in JavaScript: Mocha & Unit.js
Unit Testing in JavaScript: Should.js & Must.js
Unit Testing in JavaScript: SinonJS

Unit Testing in JavaScript: Exploring & Configuring the Mocha Testing Framework

Course Number:
it_aputjsdj_03_enus
Lesson Objectives

Unit Testing in JavaScript: Exploring & Configuring the Mocha Testing Framework

  • discover the key concepts covered in this course
  • recognize the use of the before() and after() hooks in tests
  • recognize the use of the beforeEach() and afterEach() hooks in tests
  • implement tests using multiple hooks
  • recall why the use of the arrow functions should be avoided in Mocha
  • use the done() method to signal test completion
  • set up asynchronous test functions
  • perform asynchronous testing using async/await
  • prepare Mocha tests to run within a browser
  • run Mocha tests in a browser
  • configure different reporters in Mocha
  • run multiple tests from the command line
  • summarize the key concepts covered in this course

Overview/Description

This course explores the different features available in Mocha such as before and after hooks, asynchronous operations using promises and async/await, configuring different Mocha reporters, and running Mocha on the browser.



Target

Prerequisites: none

Unit Testing in JavaScript: Mocha & Chai

Course Number:
it_aputjsdj_04_enus
Lesson Objectives

Unit Testing in JavaScript: Mocha & Chai

  • discover the key concepts covered in this course
  • install the Chai library on your local machine
  • use assertions to test boolean values
  • compare numeric values using assert
  • performing string comparisons using assert
  • describe the assertions that can be used to test objects and their properties
  • use arrays and elements in arrays using assert
  • compare and contrast the should and expect APIs in Chai
  • test different data types using should
  • test different data types using expect
  • perform asynchronous function testing using expect
  • summarize the key concepts covered in this course

Overview/Description

This course gets you started with the Chai assertion framework and the assert, should, and expect APIs in Chai for test-driven development and behavior-driven development. You will use the classic assertion API as well as the Should and Expect API in Chai to test numbers, booleans, strings, objects and object properties, and arrays in Chai.



Target

Prerequisites: none

Unit Testing in JavaScript: Mocha & Unit.js

Course Number:
it_aputjsdj_01_enus
Lesson Objectives

Unit Testing in JavaScript: Mocha & Unit.js

  • discover the key concepts covered in this course
  • install and configure the Mocha testing environment
  • install the Unit.js assertion library
  • use assertions to test boolean values
  • use assertions to test strings
  • match strings using regular expressions and custom functions
  • compare numeric values in tests
  • use assertions to test function objects
  • work with arrays and array elements
  • compare objects using equality operations
  • test objects using match
  • determine whether objects are instances of other objects
  • summarize the different ways to test errors
  • describe how values of different data types can be tested
  • summarize the key concepts covered in this course

Overview/Description

This course uses the Mocha testing framework and the Unit.js assertion library to unit test your JavaScript code. You will write unit tests to test numeric values, strings, objects, arrays, functions and exceptions using Unit.js.



Target

Prerequisites: none

Unit Testing in JavaScript: Should.js & Must.js

Course Number:
it_aputjsdj_02_enus
Lesson Objectives

Unit Testing in JavaScript: Should.js & Must.js

  • discover the key concepts covered in this course
  • recall the different styles that can be used with the Should.js API
  • describe how different data types can be tested using Should.js
  • execute assertions to check for values that evaluate to true and false using Should.js
  • perform pattern matching and substring checks using Should.js
  • evaluate numeric values using Should.js
  • examine objects and properties using Should.js
  • evaluate functions that return promises
  • recall the different styles that can be used with the Must.js API
  • run basic assertions using Must.js
  • use assertions to test different data types with Must.js
  • summarize the key concepts covered in this course

Overview/Description

This course shows you how you can use the Mocha testing framework along with Should.js and Must.js assertion libraries to test code using a chained assertion style. You will write unit tests to test numbers, strings, truthy and falsy values, objects, arrays and promises in JavaScript.



Target

Prerequisites: none

Unit Testing in JavaScript: SinonJS

Course Number:
it_aputjsdj_05_enus
Lesson Objectives

Unit Testing in JavaScript: SinonJS

  • discover the key concepts covered in this course
  • install Mocha and Sinon on your local machine
  • create an object to be used in test cases
  • use fakes to record function invocations
  • configure fakes with specific behavior
  • test the order of function invocations using fakes
  • recognize how to test errors and callbacks with fakes
  • perform asynchronous tests using fakes with promises
  • create and use anonymous spies for testing
  • wrap spies around existing functions
  • spy on specific methods of an object
  • describe the use of sandboxes for testing
  • perform testing using spies on object getters and setters
  • test real world components using spies
  • configure stub behavior in test cases
  • create stubs for object methods
  • instantiate objects without invoking object constructors
  • perform testing using mocks and set expectations
  • use spy calls to test function invocations
  • control time in tests to make asynchronous testing easy
  • use fake timers with multiple async functions
  • use sandboxes to simplify testing
  • summarize the key concepts covered in this course

Overview/Description

This course explores the use of fakes, spies, stubs, and mocks in Sinon and also the use of fake timers and sandboxes to write unit tests. You will configure fakes and spies with behavior, you will set up the right expectations for your mocks and you will control time using fake timers for asynchronous operations which use promises in JavaScript.



Target

Prerequisites: none

Close Chat Live