Ember-cli and testem


Update: I was told about the ‘ember generate acceptance-test test1’ command, and this along with ‘ember test --server’ has got me going. Thanks.


I’m new to Ember, and I’d like to get a simple project up and running, and have some integration tests running in chrome.

I bought the book “Developing an Ember.js Edge” where they create the application ember-trackr but as all things in the JS world move fast, details seem to have changed.

If I:

git clone https://github.com/developing-an-emberjs-edge/ember-trackr
cd ember-trackr

I get an error:

   Error running before_tests hook                                         
  ┃before_tests hook: "ember build -c"                                     
  ┃version: 0.0.41                                                         
  ┃You have to be inside an ember-cli project in order to use the build command.  

I’m not sure but I think the steps in http://emberjs.com/guides/testing/integration/ are already taken care of when using

ember new <appname>

So, if I create a new app and run testem:

ember new testem-test
cd testem-test

I see the ‘waiting for runners’ message in the console and chrome launces.

Now if I try to add a trivial test (say, to check the page content for some text - copied from http://www.ember-cli.com/#testing) as tests/test1.js:

 import Ember from "ember";
 import { test } from 'ember-qunit';
 import startApp from 'helpers/start-app';
 var App;
 module('An Integration test', {
   setup: function() {
     App = startApp();
   teardown: function() {
     Ember.run(App, App.destroy);
 test("Page contents", function() {
   visit('/foos').then(function() {
     equal(find('.foos-list').length, 1, "Page contains list of models");
     equal(find('.foos-list .foo-item').length, 5, "List contains expected number of models");

If I run ‘testem’, I just get the waiting for runners message. If I run ‘ember test’ I get:

~/IdeaProjects/spike/testem-test (master) $ ember test
version: 0.0.41
Build failed.
ENOENT, no such file or directory '/Users/paul/IdeaProjects/spike/testem-test/tmp/tree_merger-tmp_dest_dir-2QJNmsEl.tmp/helpers/start-app.js'
File: helpers/start-app.js

Does anyone have any clues as to what I’m missing?

Also, if it hasn’t been done already, it would be nice to keep the ember-trackr sample app up to date with ember-cli so it runs out of the box - I’d be happy to contribute if I can figure out what its missing…


It doesn’t look like it ember-trackr was developed using ember-cli. You should try the development tool-chain that they mention of in the README.md which is ember-tools not ember-cli.