-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Initial PR for ember testing guide redux #1401
Conversation
This is awesome. I think it would be really great to see some of these examples in embedded jsbins in the docs. |
@mattjmorrison that's the plan 👍 |
Sick! |
So good thanks for all the hard work on this. |
We should discuss the helpers for mocking requests. There was a long discussion on discuss.emberjs and people had strong opinions that led to the httpRespond helper, which doesn't tie to any particular ajax library dependency. This will be even more important when we make jquery an optional dep |
YUM. 👍 |
👍 I can help tackle this. |
Love, peace and understanding. This is just sick. Once this surfaces on master, I'm all in to starting doing something in @cavneb man, I don't know you, but you certainly rock. |
@cavneb excellent work on this!!! Should we add subnav to the xhr section to show several examples? Many teams might be comfortable w/ sinon/ic-ajax/etc and it might be worth showing several examples Also - is it possible we could add a test-runner section? showing both testem and karma ? |
👍 @toranb on the test-runner section. I think that can be a barrier sometimes for new folks that want to know not only how to write tests but how to integrate actually running them into their development workflow. |
Confirm. Let's stub it out and get content in place. We can smooth it out later. On Thu, Mar 27, 2014 at 10:14 AM, mattjmorrison notifications@github.com
|
@cavneb forgive my ignorance for the following question. I will gladly stub those sections out, do I do that and submit a PR to your fork, or what is the preferred way to do that? |
Good question. For now submit PR's to my fork but as soon as I can I'll get it on the ember account so we can submit PR's to a branch on there. On Thu, Mar 27, 2014 at 10:20 AM, mattjmorrison notifications@github.com
|
TODO: There are a few hyperlinks that need to be filled out... can't do it from a plane bro
TODO: This needs some love once I get on the ground and get me some WIFI.
TODO: This needs love
I'm going to take a stab at writing some jsbins for the section on models. |
I opened a PR for a first pass at some model tests. Wanted to make sure I'm on the right track. |
Initial docs for using the Karma test runner.
@JulianLeviston Thanks for all the proofing You've done us all a great service. |
whew, can't say thanks enough to people proofreading... deep down I hope you're doing it at work somewhere and getting paid for it ;) |
Daily ruffle feathers question, does anyone feel like I hijacked testing xhr a bit with the promises/run loop info? The run loop/promises in testing is super important, and kind of an underlying issue with testing xhr, but maybe it belongs in Testing Promises/run loop section preceding Testing XHR. Thoughts, concerns, complaints? |
I'm still nervous about tying the testing for xhr to a specific external dependency |
@trek @kingpin2k I personally don't use ic-ajax but if it will not allow tests to pass without having the Ember.run in the appropriate places, I'm for it. What about having a section for an alternative to ic-ajax, like mockjax (which is what I use), similar to how the test-runners section covers both |
I agree. If there isnt a standard tool to test xhr's, then maybe we need a section that explores a few external options. Thoughts? |
@mattjmorrison Both @coderstash and I use mockjax as well, we're using a one-off that wraps the resolution/rejection in the run loop though. Personally I have no preference, but ic-ajax works out of the box. I'm totally cool with writing it up saying here's a possible solution, although feel free to use xyz (just like we do with qunit) |
Added link to install node.js
Hey guys, I've been watching a PR develop over at emberjs/ember.js#4655 for the default resolver and I think it probably deserves at least a mention in the testing/debugging section. It's pretty awesome because it explains some of the magic of what ember does behind the scenes which can be super confusing to new people - things such as naming what would be auto-generated controllers slightly incorrectly, etc. It's just generally awesome because it makes Ember more explicit about what it does. I'm not sure about timings and synching up with when they'll both be released, but I'm sure someone has a general strategy for that type of thing. |
Added some initial docs for jquery-mockjax
I went through and reviewed all of the pages. The only page I am wary on adding right off the bat is the XHR page. It has awesome content but I think it needs to be flushed out a bit more. This may be better to extract out into a set of blog posts and linked to from within that doc page. I will be spending the next 30 min pulling all jsbins into my jsbin account so we can have them all in one location. Please contact me before making any more changes to this PR. I think we are ready!!!! |
@cavneb, and everyone,nice work on the testing guides! I just read through the guide, its very complete. I have one suggestion: breaking apart the RSVP promises and the XHR content into two pages: one for promises and another for AJAX. @cavneb regarding your concern about the XHR content... In my opinion this testing guide would be incomplete without the AJAX content. I think that moving the XHR content and examples off to a set of blog posts decentralizes the info, may delay adoption of at least a couple pretty good examples for mocking ajax requests. I would keep it in, and as people adopt the proposed solutions just update and iterate on the XHR page within the website testing guide. |
@pixelhandler good feedback. I agree that it may be complete, however I am unsure there is an "Ember Way" yet. Whatever the guide contains is what we support. It is important that we do have the XHR section (I was the one pushing for it since the beginning) but I don't want to have it tell the users "try this.. or this.. or this.." .. I think that would hinder us more than help. Thoughts? |
I complete agree on splitting the ajax/run loop portion of the docs (obviously I'm just restating my previous concern). And probably keep out the xhr portion until the core team has decided on general consensus. That being said, I don't care whether or not either of them go in right now (since I already know how to test with promise and the run loop ;) ). |
…all jsbins to one account
I think we are at a point where we can merge. @trek @stefanpenner @rjackson would you mind reviewing this PR? |
@cavneb Thank you for creating this guide. I've bookmarked this pull request until it gets merged and published on the official website. Very helpful indeed! :) |
@ralph we should see this go live today |
Initial PR for ember testing guide redux
Below are the examples I would like to add into these docs. If you are interested in helping, please leave a comment of which you are writing and also with the jsbin once it's completed.
Here is an example of a JSBIN with qunit testing. Please use it as a template for your examples: http://jsbin.com/mexar
Please join the IRC channel #emberjs-testing for further discussions on these examples.
Integration Tests
Unit Tests
Controllers
needs
- http://jsbin.com/fixil/2 (@coderstash)Routes
Handlebars Helpers
Models
Views
Components