ember-test-container

Light-weight container for unit testing objects that rely on Ember's Container

Usage no npm install needed!

<script type="module">
  import emberTestContainer from 'https://cdn.skypack.dev/ember-test-container';
</script>

README

Ember-test-container

Light-weight container for unit testing objects that rely on Ember's container.

Installation

npm install ember-test-container --save-dev

Usage

In any unit test import and use the buildContainer function

import Ember from 'ember';
import { module, test } from 'qunit';
import buildContainer from 'dummy/tests/helpers/build-container';
import MyUtil from 'my-app/utils/my-util';

var User;

module('My Util', {
  setup: function() {
    MyUtil.reopen({
      container: buildContainer()
    });
  }
});