-
-
Notifications
You must be signed in to change notification settings - Fork 155
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
Singletons are not destroyed between integration tests #222
Comments
In general, this is not true. Can you provide a reproduction? |
Ok... |
Here is a demo for you to tweak: http://rwjblue.jsbin.com/doqupuc/edit?html,js,output |
@rwjblue thanks for this, I actually have a repository replication the issue ready https://github.com/olivierlesnicki/ember-quunit-issue-222 I've actually been tripped up by Prototype inheritance - my issue might have nothing to do with |
However while playing around with this issue I've discovered something a bit odd that I cannot explain: right now if you run my app you see two assertions failing for // 2 assertions failling
test('it renders', function(assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.on('myAction', function(val) { ... });
this.render(hbs`{{b-component}}`);
assert.equal(this.$().text().trim(), '');
// // Template block usage:
this.render(hbs`
{{#b-component}}
template block text
{{/b-component}}
`);
assert.equal(this.$().text().trim(), 'template block text');
}); // none is failling
test('it renders', function(assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.on('myAction', function(val) { ... });
this.render(hbs`{{b-component}}`);
assert.equal(this.$().text().trim(), '');
}); |
Yes, olivierlesnicki/ember-quunit-issue-222@f95e239#diff-e71cd78cefaba8e1397165631a08bb18R4 is incorrect, setting that array there shares with all instances of a service. |
Thanks for spending time on this one. One quick question (which I've sort of alluded in my previous comment) but any idea why this test is flacky? http://jsbin.com/cuvehapoja/1/edit?html,js,output (In Chrome, refreshing the page between each test run yields different results) (see video evidence http://fr.tinypic.com/r/2qko7s2/9) |
By default QUnit runs failed tests first (they use session storage to keep track of the test ids that change). Once |
@rwjblue thanks :) |
It seems services are shared between all the component integration tests instead of being destroyed after each test.
The text was updated successfully, but these errors were encountered: