Closed muttli closed 7 years ago
@taheilo there are a few issues with your code examples above:
in the first snippet instead of returning a new Promise
instance you can just return currentSession().authenticate(...).then(...)
without the need for the resolve()
call. if the second assertion fails you would otherwise have a Promise
that is never resolved, but also never rejected because reject()
is not called anywhere.
in the second snippet you're mixing the done
callback, Ember's async andThen()
helpers and the Promise
returned from the authenticate()
method. I'd suggest to remove the done()
and return
the authenticate()
result from the andThen()
function, then it should hopefully work.
As this doesn't seem to be an issue with ember-cli-mocha
itself I'm closing this issue for now.
I've written an authentication helper that authenticates using Ember-Simple-Auth.
The authentication is working, but when using it in a test, It skips to afterEach before the test is completed.
afterEach is called, and thus the application is destroyed by the time it checks if
currentPath()
iscontrolpanel