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

Qunit not finishing on Mac OS X #97

Closed
spruce opened this issue Oct 12, 2014 · 2 comments
Closed

Qunit not finishing on Mac OS X #97

spruce opened this issue Oct 12, 2014 · 2 comments

Comments

@spruce
Copy link

spruce commented Oct 12, 2014

Hi,
I'm using ember-cli for my project. There we got some tests. For testing the existens of models we use for example:

import {test, moduleForModel} from 'ember-qunit';

moduleForModel('user', 'User', {
  // Specify the other units that are required for this test.
  needs: ['model:session', 'model:otherOne', 'model:billing']
});

test('it exists', function() {
  var model = this.subject();
  // var store = this.store();
  ok(model);
});

then it runs all tests but stops at the last test and doesn't show the stats.
when I change the needs line to:

...
needs: ['model:session', 'model:otherOne']//, 'model:billing']
...

then naturally the test fails. with this output

not ok 98 PhantomJS 1.9 - User: it exists
    ---
        actual: >
            null
        message: >
            Died on test #1     at http://localhost:7357/assets/test-support.js:418
                at test (http://localhost:7357/assets/test-support.js:284)
                at :18
                at http://localhost:7357/assets/vendor.js:77
                at http://localhost:7357/assets/test-loader.js:14: No model was found for 'billing'
        Log: >
    ...

And it also prints the stats correctly like this:

1..101
# tests 101
# pass  100
# fail  1

What am I doing wrong?

Seems to me that the helper doesn't get killed correctly.
btw: in the browser everything works great.

I come from qunitjs/qunit#683

@rwjblue
Copy link
Member

rwjblue commented Oct 12, 2014

You cannot pass a model into an assertion directly.

See ember-cli/ember-cli#1970 (comment) for details.

@rwjblue rwjblue closed this as completed Oct 12, 2014
@rwjblue
Copy link
Member

rwjblue commented Oct 12, 2014

The internal blueprints were updated in ember-cli/ember-cli#1996 to avoid generating tests that hang like this. You might be able to use the same technique.

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