You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into a rather minor, but annoying problem that can easily happen when using coffeescript to write acceptance tests. It seems to stem from returning application from the setup callback. The default coffeescript blueprint for the setup callback ends with the line application = startApp() which means that application gets returned from this function. But this causes testem/qunit to hang forever. I've only encountered this problem a couple times, usually when working with ember-data and using my http-mock express server to fake responses.
I can easily get around the problem by return null instead (as indicated in the comment in) in the example below.
`import Ember from 'ember'`
`import startApp from '../helpers/start-app'`
application = null
module 'Acceptance: SavingSettings',
setup: ->
application = startApp()
null # Hangs forever if this line isn't here and application gets returned.
teardown: ->
Ember.run application, 'destroy'
test "it's not dirty if the value is set to the same", ->
expect 3
model = null
store = getStore()
Ember.run ->
model = store.createRecord 'setting', {value: 1}
Ember.run ->
ok !!model.get('isDirty')
Ember.run ->
model.save().then (m) ->
ok !m.get('isDirty')
m.set 'value', 1
ok !m.get('isDirty')
andThen ->
null
The text was updated successfully, but these errors were encountered:
I ran into a rather minor, but annoying problem that can easily happen when using coffeescript to write acceptance tests. It seems to stem from returning
application
from thesetup
callback. The default coffeescript blueprint for thesetup
callback ends with the lineapplication = startApp()
which means thatapplication
gets returned from this function. But this causes testem/qunit to hang forever. I've only encountered this problem a couple times, usually when working with ember-data and using my http-mock express server to fake responses.I can easily get around the problem by return
null
instead (as indicated in the comment in) in the example below.The text was updated successfully, but these errors were encountered: