Log In
0% completed
All Lessons
Free Lessons (4)
Getting Started
Who Should Take This Course, and Why?
Course Content, and Code
Unit Tests
Introduction to Unit Tests
Our First Test
The Anatomy of a Test
Organizing Our Tests using Describe
Organizing Our Tests using Setup Blocks
Creating Comprehensive Test Coverage
List Comprehensions
Further Usage of List Comprehension for Test Coverage
Quiz on Basics of ExUnit
Error Cases
Testing Pure Functions
Refactoring Toward Pure Functions
Isolating Code
Finer Control over Dependency Injection
Quiz on Unit Testing Skills
Integration and End-to-End Tests
Introduction to Integration Tests
Testing Against Real External Dependencies
Dependency Doubles
Behaviors
Test Doubles: Stubs, Mocks, and Fakes
Creating Stubs
Creating Mocks
Stubbing Entire Interfaces
Quiz on Integration Testing I
Improving Performance at Compile Time
The Hidden Benefits of Dependency Doubles
Testing the Actual Interaction with Services
Building an Ad-hoc HTTP Server
Building New Test Servers Using Bypass
Recording Requests with Cassettes
Comparing Cassettes
Final Remarks on Testing External Services
End-to-end Tests
Quiz on Integration Testing II
Testing OTP
GenServer
Isolating a Functional Core
Controlling the Life Cycle of OTP Processes in Tests
Testing Periodic Actions
Black Box model in Testing Periodic Actions
Singleton Resources
Testing Resiliency
Supervision Trees
Testing Ecto Schemas
Introduction to Ecto
Testing Schema through Ecto Changesets
Refactoring Tests for Added Safety
Refactoring Tests to Be Self-updating
Extensions to Creating a Self-Updating Test
Creating a SchemaCase for Shared Test Code
Data Validation
Adding Database Interactions
Application Integration with Database
Schema Integration with Database
Testing an Ecto Schema
Testing Schema Integrations with Database
Sandbox Mode
Testing Ecto Queries
Introduction
Creating a Factory
Testing Create Operation
Testing Read Operation
Testing Update Operation
Testing Delete Operation
Testing Phoenix
Introduction
JSON-based APIs
Setup Block for Testing JSON-based APIs
Error Test for JSON-based APIs
Testing the Happy Path
Testing for the Presence of Plugs
Testing Server-rendered HTML Applications
Testing the Happy Path for Create
Testing the Error Case for Create
Testing the UserSocket
Testing a Channel
Wrapping Up
Property-Based Testing
Introduction
Example-based Tests
Randomness and Property-Based Testing
Introducing stream_data Framework
Data Generation
Generation Size
More on Generation Size
Writing Properties
Macros
Shrinking
Strategies for Designing Properties
Smoke Testing
Limits of Property-Based Testing
Stateful Property-Based Testing
Quiz on Property-Based Testing
Wrapping Up
Ensuring Elixir Application Performance with Testing and ExUnit
/
...
/
Wrapping Up
Wrapping Up
Let's wrap up the chapter.
We'll cover the following...
Summary
Summary
In
...