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

Facilitate customization of setupTest* functions #637

Merged
merged 6 commits into from
Jul 17, 2020

Conversation

kategengler
Copy link
Member

@kategengler kategengler commented Jun 5, 2020

Copy link
Member

@rwjblue rwjblue left a comment

Choose a reason for hiding this comment

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

Thank you for writing this @kategengler! I am strongly in favor of this proposal.

@rwjblue rwjblue added T-ember-cli RFCs that impact the ember-cli library T-testing labels Jun 6, 2020
Co-authored-by: Melanie Sumner <melaniersumner@gmail.com>
@ro0gr
Copy link

ro0gr commented Jun 22, 2020

What would be an import path within addons?

Is it an absolute path:

import setupTest from 'dummy/tests/helpers';

Or relative:

import setupTest from '../tests/helpers';

@jgwhite
Copy link
Contributor

jgwhite commented Jun 23, 2020

This is terrific. It seems plausible that addons could use this new convention to add their setup* functions automatically when installed. For example, ember install ember-cli-mirage could codemod tests/helpers/index.js as follows:

  import { setupApplicationTest as upstreamSetupApplicationTest } from 'ember-qunit';
+ import { setupMirage } from 'ember-cli-mirage/test-support';
  export function setupApplicationTest(hooks, options) {
    upstreamSetupApplicationTest(hooks, options);
+   setupMirage(hooks);
    // customize here
  }
  export { setupTest, setupRenderingTest } from 'ember-qunit';

@rwjblue
Copy link
Member

rwjblue commented Jun 23, 2020

@jgwhite

This is terrific. It seems plausible that addons could use this new convention to add their setup* functions automatically when installed. For example, ember install ember-cli-mirage could codemod tests/helpers/index.js as follows...

Yes, exactly.

@rwjblue
Copy link
Member

rwjblue commented Jun 23, 2020

@ro0gr

What would be an import path within addons?

It would be absolute.

@kategengler
Copy link
Member Author

We discussed this in today's framework meeting and are moving it into Final Comment Period.

Co-authored-by: Tobias Bieniek <tobias@bieniek.cloud>
@sandstrom
Copy link
Contributor

sandstrom commented Jun 30, 2020

@kategengler This would be very useful! 💯

@rwjblue
Copy link
Member

rwjblue commented Jul 17, 2020

🎉

@lougreenwood
Copy link

Are there any plans for implementing this?

We adopted this format for our project about 6 months ago, but the burden of updating the imports for generated tests is beginning to get annoying. We're considering whether to just update our local blueprints or possibly chip in on the RFC implementation if it isn't too complex.

@rwjblue
Copy link
Member

rwjblue commented Feb 17, 2021

Are there any plans for implementing this?

As far as I know, this hasn't been started by anyone. I don't think the specific implementation is terribly difficult (though perhaps there is something we missed in the initial design), and I'd be happy to help guide you through the steps if you want to pick it up (just ping me in discord).

@bertdeblock
Copy link
Member

@lougreenwood I have been working on this. The corresponding PRs are listed above.

kategengler added a commit that referenced this pull request Apr 25, 2023
Fix code examples & add ember-cli release version in #637
bmish added a commit to bmish/emberjs-rfcs that referenced this pull request May 21, 2023
* master: (56 commits)
  Fix code examples & add ember-cli release version in emberjs#637
  Update FCP guidance to include Discord
  Update RFC 085421 ready-for-release PR URL
  Advance RFC {{ inputs.rfc-number }} to Stage ready-for-release
  feat: EmberData Cache v2.1
  finalize lifetimes
  Update text/0860-ember-data-request-service.md
  Update RFC 496, typos, correct field name
  add note
  chore: update RequestService url with finalized design details
  Move emberjs#331 deprecate-globals-resolver to recommended
  Correct metadata for emberjs#487 custom model classes
  Move emberjs#625 helper-managers to recommended
  Add release date and version for 776
  Update RFC 0776 released PR URL
  Advance RFC {{ inputs.rfc-number }} to Stage released
  Update RFC 0739 ready-for-release PR URL
  Advance RFC {{ inputs.rfc-number }} to Stage ready-for-release
  Deprecate `ember-mocha`
  Add title of RFC to advancement PR titles
  ...
ef4 added a commit that referenced this pull request Oct 13, 2023
Advance RFC #637 "Facilitate customization of setupTest* functions" to Stage Recommended
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Final Comment Period T-ember-cli RFCs that impact the ember-cli library T-testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants