I am trying to get a test helper working using Ember CLI, but I always get [functionName] is undefined
. Here is my test, helper, as according to the emberjs docs:
`import Ember from "ember"`
acceptanceHelpers = ->
Ember.Test.registerAsyncHelper("performLogin", (app) ->
visit "/login"
fillIn("#username", "sampleusername")
fillIn("#password", "samplepassword")
click(".form-actions button:first")
wait()
)
`export default acceptanceHelpers`
And where I use it: login-test.coffee
:
`import Ember from "ember"`
`import startApp from "../helpers/start-app"`
`import acceptanceHelpers from "../helpers/acceptance-helpers"`
App = null
module "Acceptance: Login",
setup: ->
App = startApp()
teardown: ->
Ember.run App, "destroy"
test "User is able to log in / transition to dashboard", ->
performLogin()
andThen ->
equal(currentRouteName(), "dashboard")
But I get:
ReferenceError: performLogin is not defined at Object.module.setup (unhost/tests/acceptance/login-test.js:15:16) at Object.Test.setup (http://
localhost
:4200/assets/test-support.js:1063:31) at http://localhost
:4200/assets/test-support.js:1168:10 at process (http://localhost
:4200/assets/test-support.js:887:24) at http://localhost
:4200/assets/test-support.js:476:5
How can I configure my acceptance test to properly use defined test helpers in Ember CLI?