1

I am writing my first ever ember tests. I am using ember-cli and ember 1.13.6 with simple-auth 0.8.0

I am seeing some baffling behavior while running my tests in headless mode with phantom.js

authenticateSession() from the ember-simple-auth library works when called before the first andThen as in the previous example but fails with the error ReferenceError: Can't find variable: Promise if called after the first andThen() like:

test('unauthenticated', function(assert) {
  assert.expect(1);
  visit('/maps');

  andThen(function() {
    assert.equal(currentURL(), '/login', "viewing authenticated routes while unauthenticated redirects to login");
  });

  //calling authenticateSession() after an andThen() blows up
  authenticateSession();
});
Andrew
  • 942
  • 10
  • 26

0 Answers0