-
-
Notifications
You must be signed in to change notification settings - Fork 407
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
Test Directories #575
Test Directories #575
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
- Start Date: 2020-01=09 | ||
- Relevant Team(s): Ember.js | ||
- RFC PR: https://github.com/emberjs/rfcs/pull/575 | ||
- Tracking: | ||
|
||
# Test Directories | ||
|
||
## Summary | ||
|
||
This RFC proposes that we change the names of an Ember app's test directories to reflect the names | ||
in the guides. For example, instead of `tests/acceptance/*-test.js`, we should have | ||
`tests/application/*-test.js`. | ||
|
||
## Motivation | ||
|
||
Renaming test directories to match the Guides will make it easier to have a shared language | ||
between tests, and to reduce confusion for newer users when using Ember CLI. | ||
|
||
## Detailed design | ||
|
||
These are the directory transformations that need to happen: | ||
|
||
- tests/acceptance -> tests/application | ||
- tests/integration > tests/rendering | ||
- tests/unit/utils -> tests/unit | ||
- tests/unit/controllers -> tests/container/controllers | ||
- tests/unit/routes -> tests/container/routes | ||
- tests/unit/services -> tests/container/services | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These list does not include all directories, in which tests are created by existing blueprints. All folders used by Ember Data to place tests in are missing:
Also the tests created for components and helpers if
Same it true for not that popular features like mixins and (instance) initializers. The RFC should also say what should happen to these. Not sure how the RFC should handle folders in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wasn't attempting to solve for Ember Data unit tests! Those generators can keep doing whatever they want IMO. @runspired or someone else from ED, do you want to expand this RFC to address those as well? |
||
|
||
The changes required are: | ||
|
||
- Updating the default blueprint for Ember apps | ||
- Updating the generators for these types of tests to create files in the right directories with the right module names. | ||
- Providing a codemod or script to move these files around. | ||
|
||
## How we teach this | ||
|
||
This new lexicon is already in the Ember guides, but it's possibly that a blog post noting the old | ||
verbiage would be useful as a point of reference. | ||
|
||
## Drawbacks | ||
|
||
Almost no code will change (except the string names of test modules), so it's possible that this | ||
will be seen as unnecessary churn. | ||
|
||
## Alternatives | ||
|
||
An alternative would be do document that when the guides talk about Application tests, they are | ||
referring the `tests/acceptance` directory, and so on. | ||
|
||
## Unresolved questions | ||
|
||
- There's a possibility that there are Ember apps out there that are not using the default directory | ||
structure provided by Ember CLI. If a custom directory structure is used, what is the way to solve this? | ||
- Apps using `pods`. I'm not sure of the directory structure for tests created by pods. It's not | ||
clear if this RFC should include trying to codemod those. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have a reason these are called container now? I think unit is generally a good way to look at testing this at the interface level.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure where that comes from. I scanned #268 and #119 but they don't seem to be the place where the terminology is introduced. Maybe @rwjblue knows?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From his comments above, it does seem like #268 is where they came up:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking through #268 I can't seem to find the introduction of it in the doc or comments.