-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[ENHANCEMENT] Friendly test names and descriptions #3945
[ENHANCEMENT] Friendly test names and descriptions #3945
Conversation
Added a test-info utility and refactored test blueprints to provide more friendly names and or descriptions. The test-info utility contains a few methods humanize -> convert string to humanized form name -> return a test name with prefix description - > return a test description with prefix The prefix includes the test type (Unit or Acceptance) as well as the blueprint type (model, adapter, component, mixin, etc) The end result is that tests will have better names and descriptions when displayed inside qunit user interface. Some examples Unit | Component | x-foo Unit | Route | foo Unit | Controller | foo Acceptance | my cool feature
LGTM – @jgwhite r? |
Also, I am thinking that the Not sure what those might be yet but perhaps there are some interesting use cases. Perhaps stuff like dynamically populating the needs array or passing more complicated test setup boilerplate in a reasonably DRY way. Anyway that is why I called it |
@stefanpenner confirm 👍 iojs failure seems unrelated. |
Interesting the iojs failures on travis. Local tests run fine using iojs v1.5.1 |
@eccegordo re-triggering – we have a race condition which is hopefully just in our tests, that becomes more apparent in iojs. Some weekend, i will dig into it. |
For some reason I can not start Appveyor but I would like to get this merged. |
…tions [ENHANCEMENT] Friendly test names and descriptions
these aren't intermittent windows error, but they are unrelated to this PR. |
Woot! Thanks for merging. |
ret = testType + SEPARATOR + this.humanize(description); | ||
} | ||
return ret; | ||
} |
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.
@eccegordo @stefanpenner I'm wondering why the implementation of name()
and description()
is completely identical. was that intentional? also it currently seems impossible to generate Unit | Components | x-foo
because the dash in x-foo
will be removed, so it seems that the documentation does not match the implementation in some cases.
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.
I believe at the time name and description were just two values in the various test files in different places but I was not sure of the distinction myself. They appeared to emit the same content. Might just be some minor inconsistency in the blueprints. Maybe stefan knows better than I what is correct. But yes it was intentional but might not be correct.
Added a test-info utility and refactored test blueprints to provide more friendly names and or descriptions.
The test-info utility contains a few methods
humanize -> convert string to humanized form
name -> return a test name with prefix
description - > return a test description with prefix
The prefix includes the test type (Unit or Acceptance) as well as the blueprint type (model, adapter, component, mixin, etc)
The end result is that tests will have better names and descriptions when displayed inside qunit user interface.
Some examples
Unit | Component | x-foo
Unit | Route | foo
Unit | Controller | foo
Acceptance | my cool feature