Ember Try

4.0.0 · active · verified Tue Apr 21

Ember Try is an Ember CLI addon designed to facilitate testing Ember applications and addons against various versions of their dependencies, particularly `ember` and `ember-data`. The current stable version is 4.0.0, released in March 2025. It allows developers to define "scenarios" that modify `package.json` dependencies, install them, run a specified command (usually `ember test`), and then revert the changes. This is crucial for maintaining compatibility across different Ember ecosystem versions. Its primary differentiators include deep integration with `ember-cli`, a declarative configuration for scenarios, and commands like `ember try:each` for iterative testing and `ember try:one` for specific scenario runs. It also supports automatic scenario generation based on `semver` ranges in `package.json` via its `versionCompatibility` feature, making it a cornerstone for robust Ember ecosystem testing. The release cadence appears tied to major Ember CLI or Node.js ecosystem shifts, with major versions released periodically to address breaking changes and new features.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to install `ember-try`, configure a `config/ember-try.js` file with basic scenarios for different Ember versions (default, release, beta, canary), and then execute tests across all defined scenarios using the `ember try:each` command. This setup is common for CI environments.

// First, install ember-try in your Ember CLI project:
ember install ember-try

// This will typically create or update 'config/ember-try.js'.
// Modify 'config/ember-try.js' to define your testing scenarios:
module.exports = function(/* app */) {
  return {
    useVersionCompatibility: true, // Auto-generate scenarios from package.json if desired
    scenarios: [
      {
        name: 'ember-default',
        npm: {
          devDependencies: {} // Uses dependencies defined in your project's package.json
        }
      },
      {
        name: 'ember-release',
        npm: {
          devDependencies: {
            'ember-source': 'release' // Test against the latest stable Ember release
          }
        }
      },
      {
        name: 'ember-beta',
        npm: {
          devDependencies: {
            'ember-source': 'beta' // Test against the Ember beta channel
          }
        },
        allowedToFail: true // Beta/Canary scenarios can be configured to fail without blocking CI
      },
      {
        name: 'ember-canary',
        npm: {
          devDependencies: {
            'ember-source': 'canary' // Test against the Ember canary channel
          }
        },
        allowedToFail: true
      }
    ]
  };
};

// Then, run the `ember try:each` command to execute tests for all scenarios:
ember try:each

view raw JSON →