Questions tagged [ember-qunit]

Unit test helpers for Ember applications.

Ember-qunit is a tool design to enhance the ability to write unit tests for Ember applications.

Ember QUnit uses your application's resolver to find and automatically create test subjects for you with the moduleFor and test helpers.

See more:

160 questions
6
votes
1 answer

Uncaught Error: Could not find module `ember-qunit`. Odd out-of-the-box ember-cli behavior

I believe I may have an environment issue here, but I'm quite stuck as to what I can to do resolve it. I created an ember-cli project, committed it to git, added a few things. I ran the typical npm install && bower install commands and tried ember…
atschaal
  • 355
  • 1
  • 14
6
votes
3 answers

Ember testing: You have turned on testing mode, which disabled the run-loop's autorun

I am trying to write a simple Ember integration test and continue to get the frustrating run loop error despite using Ember.run. I've had a nightmare of a time trying to get this to work, if anyone could help me I'd be so grateful. Specifically, I…
5
votes
1 answer

Can I setup a QUnit hook to run before all tests in a suite?

I'm using ember-qunit and have a service in my app that makes some nontrivial api calls. To handle this, I'm using a test helper: // tests/helpers/mock-my-service.js import { mock } from 'ember-data-factory-guy'; export function…
Glyoko
  • 2,071
  • 1
  • 14
  • 28
5
votes
4 answers

ember Error: Assertion Failed: fullName must be a proper full name

I got the following error while running a test with Ember.js: Promise rejected before "...": Assertion Failed: fullName must be a proper full name What is the meaning of this error?
Ahmet Emre Kilinc
  • 5,489
  • 12
  • 30
  • 42
5
votes
2 answers

Unit Testing Ember Services that Fetch Data

I have an ember service thats primary concern is to fetch data for a specific model and the descendants of the model. The reason I am using this in a service is because the route for this particular type is using a slug which is not the primary key…
BillPull
  • 6,853
  • 15
  • 60
  • 99
5
votes
1 answer

Ember Error while testing: You will need to wrap any code with asynchronous side-effects in a run

We already have a app working just working to add test cases to it for the purpose of CI. We have a small code that tries the login process and checking what happens after the possible login states like success, failure, invalid account account…
Balwant Singh
  • 287
  • 5
  • 14
5
votes
2 answers

Test for throwing Errors in Ember.js

Using the integrated QUnit testing framweork I need to test wether or not visiting a route causes an Error to be thrown. There is a Handlebars helper in the route that should throw an Error under certain conditions (failed Assertion). How do I test…
buschtoens
  • 8,091
  • 9
  • 42
  • 60
5
votes
2 answers

"Attempting to register an unknown factory" in model test

I have these models in an ember-cli app: var PuzzleRound = DS.Model.extend({ year: DS.attr('number') }); var Puzzle = DS.Model.extend({ puzzleRounds: DS.hasMany('puzzleRound', {async: true}) }); And here's my test from…
nnyby
  • 4,748
  • 10
  • 49
  • 105
5
votes
2 answers

How to test function that calls Ember.run.debounce in ember-qunit?

The controller I would like to test contains the following: filterText: '', filteredFoos: (Ember.A()), filterFoosImpl: function() { console.log('filterFoos begin' ); var filterText = this.get('filterText'); var filteredFoos =…
bguiz
  • 27,371
  • 47
  • 154
  • 243
5
votes
1 answer

Using ember-qunit to test controllers with a store (DS.FixtureAdapter)

I have an ember-qunit test case for a controller (using moduleFor('controller:name', ...)) that that I'd like to be able to use the moduleForModel-exclusive this.store() in order to retrieve a DS.FixtureAdapter data store. For this specific test…
jeninto
  • 53
  • 3
4
votes
1 answer

Ember concurrency timeout hanging in qunit

In Ember I have a component that starts a never-ending poll to keep some data up to date. Like so: export default Component.extend({ pollTask: task(function * () { while(true) { yield timeout(this.get('pollRate')); …
Glyoko
  • 2,071
  • 1
  • 14
  • 28
4
votes
1 answer

Log to terminal when QUnit test suite completes?

When my test suite completes, I need to output some stats, i. e. meta info about tests collected during test execution. I'm trying this: QUnit.done(() => console.log("some meta info here")) This works when I run tests in the browser. But when I run…
Andrey Mikhaylov - lolmaus
  • 23,107
  • 6
  • 84
  • 133
4
votes
1 answer

Unable to find partial in a component test

I have a component test that is failing because it can't find a partial that the template is rendering. The specific error is "Assertion Failed: Unable to find partial with name 'components/activity-list-item-content'." My test file is basically the…
Peter Brown
  • 50,956
  • 18
  • 113
  • 146
4
votes
1 answer

Initialized dependency not present when testing

I'm using ember-cli 0.0.35, and injecting a dependency onto my component via an initializer. It works great in development, but the property isn't present when I run tests. It appears that testing calls loadInitializers, but the dependency is not…
4
votes
1 answer

How to set model data in an Ember.js unit test for a controller

I'm trying to write a unit test to test my controller. I have a computed property that uses a computed property on the model. I'm unsure of how to setup the test to load the data into the model. Here I have my model: App.User = DS.Model.extend({ …
bfcoder
  • 3,042
  • 2
  • 28
  • 35
1
2
3
10 11