Skip to content

Instantly share code, notes, and snippets.

@alexander-alvarez
Last active December 6, 2017 19:12
Show Gist options
  • Save alexander-alvarez/d860388b0e848e50e8bd25960aac6fc5 to your computer and use it in GitHub Desktop.
Save alexander-alvarez/d860388b0e848e50e8bd25960aac6fc5 to your computer and use it in GitHub Desktop.
Qunit Blueprints Quest Issue.md

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 ember-cli@2.17), 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

  • 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
  • Add <type>-test "simplified QUnit" blueprints
    • acceptance-test * (Not yet implemented, updates are being worked on by @rwjblue in ember-test-helpers, we cannot add these blueprints until the RFC 268 implementation is finished)
    • component-test
    • controller-test
    • helper-test
    • initializer-test
    • instance-initializer-test
    • mixin-test
    • route-test
    • service-test
    • util-test
  • 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)
  • 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)
@rwjblue
Copy link

rwjblue commented Dec 6, 2017

qunit-simple-files

Lets change this to qunit-rfc-232-files?

which is in the default blueprint as of ember-source@2.17

I believe its actually ember-cli@2.17

Currently, we have no way to generate these test files but we can run the ember-qunit-codemod to migrate test files.

What about adding a snippet to the end like:

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment