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

Add v3 API to README. #293

Closed
rwjblue opened this issue Nov 5, 2017 · 10 comments
Closed

Add v3 API to README. #293

rwjblue opened this issue Nov 5, 2017 · 10 comments

Comments

@rwjblue
Copy link
Member

rwjblue commented Nov 5, 2017

The new setupTest / setupRenderingTest API's need to be documented in the README. The existing moduleFor* API's should continue to be listed, but be less prominent.

@jacobq
Copy link

jacobq commented Feb 14, 2018

Is this mainly the switch to using promises? #292 I'm still early in the learning process of Ember app testing but would be willing to give this a shot.

@acorncom
Copy link

@jacobq The new testing approach is documented on guides at this point (currently at https://guides.emberjs.com/v2.18.0/testing/acceptance/ but once I'm finished with a deploy here, 2.18 won't have it documented but https://guides.emberjs.com/v3.0.0/testing/acceptance/ will)

@jacobq
Copy link

jacobq commented Feb 14, 2018

@acorncom OK, I was wondering about that. I'll keep working my way through the guide pages on testing and will plan to start a PR with the readme changes here after the 3.0 guides are up.

@acorncom
Copy link

@jacobq K, 3.0 release is up, would love to hear if you hit any snags on the latest testing info there 😀

@jacobq
Copy link

jacobq commented Feb 23, 2018

@acorncom Could you help me understand what start-app.js does?
The guides mention that you need to add your custom helpers to it when writing tests for an application, but this file doesn't appear to exist in new addons, and I'm wondering how to bring-in custom helpers there. (In particular, I am trying to update ember-sortable to use ember-cli 3.0 and the new testing conventions.)

It looks to me like RFC268 says start-app.js isn't needed / used anymore. There are also some references to this in the ember-cli guide.

@acorncom
Copy link

@jacobq I believe your reading of that RFC is accurate. When I check the latest app blueprints, it looks like we now use tests/test-helper.js which would be where any global helpers might be registered. But I'm not positive on that. Might be worth opening a PR where your writeup can be critiqued ...

@Turbo87
Copy link
Member

Turbo87 commented Mar 1, 2018

it looks like we now use tests/test-helper.js which would be where any global helpers might be registered.

there should not be any "global helpers" anymore. if you require any helper functions you should explicitly import them instead of using the registerAsyncHelper() functions.

@jacobq
Copy link

jacobq commented Mar 1, 2018

@Turbo87, OK, but then why does ember g test-helper some-helper generate (e-cli 3.1.0-beta.1) generate the code below? Do the blueprints and guide need to be updated to reflect this?

import { registerAsyncHelper } from '@ember/test';

export default registerAsyncHelper('someHelper', function(app) {

});

@Turbo87
Copy link
Member

Turbo87 commented Mar 1, 2018

because there is no such thing as a "test-helper" anymore and that blueprint should be deleted IMHO

@rwjblue
Copy link
Member Author

rwjblue commented Mar 12, 2018

Fixed by #320

@rwjblue rwjblue closed this as completed Mar 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants