Ember.js: QUnit Blueprints Quest Issue

Created on 6 Dec 2017  ·  30Comments  ·  Source: emberjs/ember.js

__Background__
We need to implement changes in blueprints and docs realted to [RFC 232] and [RFC 268].
(Some background for those unfamiliar http://rwjblue.com/2017/10/23/ember-qunit-simplication/)

As of ember-cli-qunit@^4.1.1 (which is in the default blueprint as of [email protected]), we can implement the "Simplified QUnit" style tests in all tests except for acceptance tests.
In a future release of ember-qunit (likely 3.2.x), we will be able to leverage the implementation of setupApplicationTest from [RFC 268] for use in acceptance-tests. Once these changes are implemented upstream, we must implement the blueprint updates.
Currently, we have no way to generate these test files but we can run the [ember-qunit-codemod] to migrate test files and continue to iterate on the final output in the blueprint specific pull requests.

The desired behavior when generating testing blueprints is to, generate "Simplified QUnit" style tests if supported by the host app. We have several tasks below to extend the blueprints to support the "Simplified QUnit" style blueprints alongside the legacy, and ember-mocha blueprints. We can likely add to the behavior of [test-framework-detector.js] to support this other extension. Once these changes are completed we also need to update the guides to be consistent with the current ember-cli codebase. We should work with @rwjblue and the learning team (cc @locks) to determine how we best teach this.

__Tasks__

  • [x] (🔒 @Turbo87) Extend [test-framework-detector.js] to support a directory called qunit-rfc-232-files which will be where the "Simplified QUnit" blueprints will live in each of the blueprint test folders (e.g blueprints/component-test/qunit-rfc-232-files/). The decision to use the qunit-rfc-232-files directory should be based on the host's ember-cli-qunit
  • [x] Add <type>-test "simplified QUnit" blueprints

    • [x] acceptance-test - https://github.com/emberjs/ember.js/issues/15999

    • [x] (🔒 @Turbo87) component-test

    • [x] (🔒 @snewcomer) controller-test

    • [x] (🔒 @snewcomer) helper-test

    • [x] (🔒 @snewcomer) initializer-test

    • [x] (🔒 @snewcomer) instance-initializer-test

    • [x] (🔒 @boyanyordanov) mixin-test

    • [x] (:lock: @rwwagner90) route-test

    • [x] (🔒 @boyanyordanov) service-test

    • [x] (🔒 @snewcomer) util-test

  • [x] (🔒 @alexander-alvarez) Extract the above tests blueprints into a standalone polyfill addon https://github.com/alexander-alvarez/ember-qunit-nested-module-blueprints-polyfill so developers can access the new testing blueprints regardless of what version of ember-cli they are on (so long as they are running ember-cli-qunit@^4.1.1)
  • [x] (:lock: @jessica-jordan) Update testing section in https://github.com/emberjs/guides to reflect new style (note this should land very close to when the changes above are implemented)

To pick up one of these items, please comment below and we'll update the checklist with :lock: @your-name-here...

Feature Help Wanted Meta

All 30 comments

Awesome, thanks for organizing this @alexander-alvarez!

@alexander-alvarez should we use qunit for the new API blueprints and something else instead of qunit for the old blueprints? this would seem more intuitive to me 🤔

also I'm wondering if we should do the implementation in https://github.com/alexander-alvarez/ember-qunit-nested-module-blueprints-polyfill first and once those are solid we can import them here

@Turbo87 - I'd prefer to land the "real" implementations first (so that the polyfill truly is a polyfill). If that turns out to be costly (or I'm too much of a blocker in landing PR's) we can swap to targeting the polyfill addon first...

OK, first implementation is done and landed (along with the test framework detector changes required to support the path forward). The game is afoot!

Doing the helper-test right now.

@rwjblue I'm always happy to work on blueprints. Want to assign a couple my way?

@rwwagner90 choose one and announce it here, so that others are not doing the same work too :)

@Turbo87 I'm not picky, but I'll randomly choose route-test

Updated description:

  • :lock: route-test for @rwwagner90
  • helper-test
  • component-test

Tackling controller && initializer && instance-initializer tests in 3 separate PR's!

If there's anything left I could take one.

@christophermlne mixin, service, and ~util~ are still up for grabs

Taking the utils. @christophermlne lmk if you want to tackle that one or want to take on either service or mixin!

I will try to do mixin and if I manage I will look into service as well.
I haven't contributed to ember yet so I don't know if I'll be in over my head.

I haven't contributed to ember yet so I don't know if I'll be in over my head.

@boyanyordanov don't worry, we're here to help you if you have questions :)

I'll go ahead and add a PR for service-test too.

Looks like a lot happened while I was sleeping ;-) Let me know if there is still anything left to do.

I'd like to update the testing section in the guides for these changes

Thanks @jessica-jordan :smile:, it's all yours

@alexander-alvarez - All of the blueprints other than acceptance are done. You are probably good to go on extracting to the polyfill addon...

I'll get around to it ASAP

I have 8 branches to push up in the polyfill repo once I get online again :D

Looks good, I think all if the polyfill addon PRs are merged at this point.

Now only think left is the acceptance-test blueprint which we can do once https://github.com/emberjs/ember-qunit/pull/302 is reviewed and released.

https://github.com/emberjs/ember.js/issues/15999 implements the acceptance-test blueprint.

It also bumps the minimum version of ember-cli-qunit to 4.2.0.

@locks / @jessica-jordan - Do y'all want to track the guides work here, or would it be better to make a guides specific issue for the remaining work item?

@rwjblue Personally, I'm happy to track it here, but I'm good with either solution

Thanks everyone for your hard work here!

Was this page helpful?
0 / 5 - 0 ratings