home
  • Blog
1.10
  • Getting Started
  • Getting Ember
  • Concepts
  • The Object Model
  • Application
  • Templates
  • Routing
  • Components
  • Controllers
  • Models
  • Views
  • Enumerables
  • Testing
    • Introduction
    • Integration Tests
    • Test Helpers
    • Testing User Interaction
    • Unit Testing Basics
    • Unit Test Helpers
    • Testing Components
    • Testing Controllers
    • Testing Routes
    • Testing Models
    • Automating Tests with Runners
  • Configuring Ember.js
  • Cookbook
  • Understanding Ember.js
  • Contributing to Ember.js
Old Guides - You are viewing the guides for Ember v1.10.0.
Go to v5.0.0

Introduction

Edit pencil

Testing is a core part of the Ember framework and its development cycle.

Let's assume you are writing an Ember application which will serve as a blog. This application would likely include models such as user and post. It would also include interactions such as login and create post. Let's finally assume that you would like to have automated tests in place for your application.

There are two different classifications of tests that you will need: Integration and Unit.

Integration Tests

Integration tests are used to test user interaction and application flow. With the example scenario above, some integration tests you might write are:

  • A user is able to log in via the login form.
  • A user is able to create a blog post.
  • A visitor does not have access to the admin panel.

Unit Tests

Unit tests are used to test isolated chunks of functionality, or "units" without worrying about their dependencies. Some examples of unit tests for the scenario above might be:

  • A user has a role
  • A user has a username
  • A user has a fullname attribute which is the aggregate of its first and last names with a space between
  • A post has a title
  • A post's title must be no longer than 50 characters

Testing Frameworks

QUnit is the default testing framework for this guide, but others are supported through third-party adapters.

Contributing

The Ember testing guide provides best practices and examples on how to test your Ember applications. If you find any errors or believe the documentation can be improved, please feel free to contribute.

left arrow
Introduction
Integration Tests
right arrow
On this page

  • Integration Tests
  • Unit Tests
  • Testing Frameworks
  • Contributing
Team Sponsors Security Legal Branding Community Guidelines
Twitter GitHub Discord Mastodon

If you want help you can contact us by email, open an issue, or get realtime help by joining the Ember Discord.

© Copyright 2023 - Tilde Inc.
Ember.js is free, open source and always will be.


Ember is generously supported by
blue