Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Replace autostart behavior with hook to start tests. #176

Merged
merged 1 commit into from
Mar 25, 2017

Conversation

rwjblue
Copy link
Member

@rwjblue rwjblue commented Mar 25, 2017

Prior to this change, tests automatically started once DOMContentLoaded fires. This means that there is no obvious mechanism to hook into the system after boot, but before
tests start (e.g. to load lazy engine assets).

This is a somewhat breaking change, apps will have to update their tests/test-helper.js to properly kick off the tests.

The change is pretty trivial:

// tests/test-helper.js

import { start } from 'ember-cli-qunit';
// ...snip current content...
start();

Closes #171.

@rwjblue rwjblue requested a review from trentmwillis March 25, 2017 20:51
Copy link
Member

@trentmwillis trentmwillis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good to me! Don't forget to update the Ember-CLI blueprints once this is released.

}
});

export class TestLoader extends AbstractTestLoader {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving this as a note to myself: if ember-exam breaks, come check this. I don't think it should though.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha. I just figured this was better than monkey patching the prototype.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely is, just unsure if it breaks any assumptions in the ember-exam code (been awhile since I looked at it haha)

@trentmwillis
Copy link
Member

Irony: not updating the test-helper.js in this repo 😛

Prior to this change, tests automatically started once DOMContentLoaded
fires. This means that there is no obvious mechanism to hook into the
system after boot, but before tests start (e.g. to load lazy engine
assets).

This is a somewhat breaking change, apps will have to update their
`tests/test-helper.js` to properly kick off the tests.

The change is pretty trivial:

```js
// tests/test-helper.js

import { start } from 'ember-cli-qunit';
// ...snip current content...
start();
```
@rwjblue
Copy link
Member Author

rwjblue commented Mar 25, 2017

HAHA! Yes, I did forget that, but I also missed some other work that I had deleted and forgot to copy.

Updated now, might want to do another pass...

@rwjblue rwjblue merged commit ea52fd4 into ember-cli:master Mar 25, 2017
@rwjblue rwjblue deleted the manual-start branch March 25, 2017 21:41
@Turbo87
Copy link
Member

Turbo87 commented Apr 6, 2017

@rwjblue do we need something similar for ember-cli-mocha?

@rwjblue
Copy link
Member Author

rwjblue commented Apr 6, 2017

@Turbo87 - Yes, if you want your API to follow suit...

@hjdivad
Copy link
Contributor

hjdivad commented Apr 6, 2017

This has the nice side benefit of improving the ergo for debugging tests that loop, as you can open dev tools before running the tests that cause chrome to thrash.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants