question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Integration test method to "destroy" the component

See original GitHub issue

Is there a way to destroy the tested component in integration tests?

I had the issue where async behavior were setting internal properties on the component on completion. The problem is sometimes the component was destroyed before the async behavior had completed, resulting in an error.

While I fixed the code to handle this situation I would have liked to implement a corresponding test. And maybe use something such as this.destroy() to check the race condition.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
rwjbluecommented, Feb 22, 2016

In more recent ember-qunit versions, you can do:

this.clearRender()
1reaction
jakeleboeufcommented, Jul 28, 2017

@rwjblue how do I implement this?

test('it renders as canvas', function(assert) {
  this.render(hbs`{{body-movin path="loading" renderType="canvas"}}`);

  return wait().then(() => {
    assert.notEqual(this.$('canvas').get(0), undefined);
    this.clearRender(); // where should this go?
  });
});
Read more comments on GitHub >

github_iconTop Results From Across the Web

Ember: Testing WillDestroyElement Logic of Component in an ...
Usually it's done in unit tests to test willDestroyElement , I think it should be possible in integration tests maybe using some conditions....
Read more >
14. Integration Testing - Spring
Used to annotate a test class or test method to configure SQL scripts to be executed against a given database during integration tests....
Read more >
Getting Integration Testing Right - Semaphore CI
An integration test verifies components' interaction with the external system (database, message queue, etc.). Integration tests may affect each ...
Read more >
Unit and integration testing in an Angular 4 environment
Create a new beforeEach where the component under test is created in the configured Angular test module, under the name “fixture.” Destroy the ......
Read more >
What is Integration Testing (I&T)? - TechTarget
Integration testing -- also known as integration and testing (I&T) -- is a type of software testing in which the different units, modules...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found