-
Notifications
You must be signed in to change notification settings - Fork 14
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
Plugin registration API such that plugins are registered in the helper? #30
Comments
Mocha ran into similar ordering/timing problems with the myriad use cases which depended on the I swear there's a way to accomplish what you want as-is, though. I need to go spelunk a bit. |
Ah, right, the closest example to this I have is in this example project: The configurator does indeed need to be specified in the package.json, but what if we just established a conventional path for it as well in a minor bump? That way you could have a conventional hook for plugin registration |
A PR would probably amount to setting this to something and potentially guarding against its absence: teenytest/lib/configure/defaults.js Line 8 in fc2bd4b
I have no idea what I'd call it, though. Suggestions? |
Perhaps? I was kinda thinking that we could just have |
hmmm… I'm not necessarily opposed to that but I'm struggling to visualize. I'd personally like to keep "tests" and "config" separate, but I don't have a super clear reasoning |
Realizing that plugins are trivially registered via the CLI or package.json... However, the best part of teenytest is its conventional defaults. As such I want my CLI invocation to just be
teenytest
and I don't want to have to add ateenytest
stanza to my package.json.Alternatively, I'm thinking the ability to easily register plugins within the conventional test helper would be nice? (Likely this would really just be the facility to configure anything in teenytest, not just plugins.)
require('teenytest').plugins
returns the plugin store, but plugins can't be registered until a run has begun. However, invoking the main exported function kicks off the run (which has technically already begun since we're in the helper file.)Wondering if it makes sense for the test helper to have access to the currently in-process test run? I have lots of ideas here but they're all kinda kludgy. Has anyone else thought about this at all?
possible options:
require('teenytest')
during a run has access to manipulate the current configuration)require('teenytest').plugins
to reference an in-process test run. (I'm already confused as to why this is exported as it currently is, when it's really an ephemeral property instantiated during the run.)The text was updated successfully, but these errors were encountered: