Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem returning application from qunit setup module callback #123

Closed
kbullaughey opened this issue Feb 2, 2015 · 1 comment
Closed

Comments

@kbullaughey
Copy link

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
@Turbo87
Copy link
Member

Turbo87 commented Oct 14, 2017

this seems no longer relevant, closing due to age

@Turbo87 Turbo87 closed this as completed Oct 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants