-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Support for ES2015 classes as tests containers in the exports
UI
#2462
Comments
it would be awesome to have this :) |
Is there any particular advantage to doing this beyond looking more like other systems (mostly unrelated ones with different needs, goals and/or environments, I might add)? Potential problems I can foresee include:
|
@ScottFreeCode none for me, but I'd put it in a more positive way. To rephrase succinctly my initial post, I think that would improve the UX of the
I disagree. Other test runners live under different environments, yes, but they share their core goal of running tests. In this context, UI familiarity is a feature, as it helps newcomers already familiar with the pattern from TestRunnerX when they move to Mocha for a new project. Apart from this, I have nothing to add to your technical points, they all sound legitimate. |
I agree w/ most of @ScottFreeCode's points. Most concerning is the behavior of
Either way, this would best be done in a new interface entirely; in the former, to avoid ambiguity, and in the latter, to expose the class. Looking at similar tools in other languages, you're going to want "TDD-style" setup and teardown functions instead of
This is a bigger issue than you'd think. Anything we can do to streamline and simplify reduces the support burden.
I'm not convinced we need to increase adoption of any interface other than the default TL;DR: The current I'm going to close this, but it's a neat idea nonetheless. |
Tangentially (sorry for the late followup), I don't think we have documentation of how to write a custom interface; should we put together an issue to add that (or add it to a general needed-documentation issue such as #2282)? |
Hi.
I'm discovering and using Mocha for a fresh ES2015/2017 node app, and am enjoying the
exports
UI. To my eyes, it makes for concise and "normal-looking" test code, especially when used with ES2015 exports (which I get through Babel):It works great and running Mocha tells me:
Now, say I want to group
test_a
andtest_b
into aSuiteOne
test suite. With the currentexports
interface, if I understand correctly, I have to:Yay:
Awesome, but I was thinking:
class
keyword...class
instead of customReact.createClass()
to declare components, enabling relying on a close-enough standard construct/syntax rather than custom APIs....... I was wondering if it would make sense to make Mocha understand classes as tests containers:
would output:
Wouldn't that look good / has this already been considered? Thanks for Mocha!
The text was updated successfully, but these errors were encountered: