-
Notifications
You must be signed in to change notification settings - Fork 4
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
Compatibilty/legacy support for Mocha testcases #36
Comments
This should be doable to implement by a custom Mocha runner/reporter. It would use the Mocha apis to find and execute tests, collect results. Challenges are:
|
Possible implementation strategyTL:DR automatically generate a set of fbp-spec testcases from Mocha, which are executed by a NoFlo fixture, that runs the Mocha testcase and reports the result.
Ideally we use a fixture graph of NoFlo components to set up and execute all the logic, so that we do not need a special implementation of FBP runtime protocol. |
One little bit tricky thing is to figure out how to multiplex legacy cases and non-legacy cases across the same runtime connection. It could be that the best approach is to let this mocha-legacy-compat tool proxy communication to the real runtime. Especially since this is a feature we want to have/build also for MsgFlo (msgflo/msgflo#28). We also need to avoid double-detection of the proper fbp-spec cases when those are using the Mocha runner integration. Should be doable by that integraiton detecting when we are in this legacy mode. |
Hopefully using the Mocha third party hooks for UI/interface and reporter, we can do this without dirty hacking: There are a bunch of existing extensions mentioned here, https://github.com/mochajs/mocha/wiki |
Bad news first: It seems that using the
This would one would need to use a custom entry point. For node.js, likely an Good news: |
Can read a set of Mocha testcases, build them into fbp-spec test-suites, and act as a FBP runtime which can execute these tests and enforce the results. Needs a bit more work before being minimally useful References #36
Still need some tests, bugfixing and documentation. |
References #36 Hopefully last pieces to run most real tests
References #36 Hopefully last pieces to run most real tests
Right now we have, across component libraries and projects, many existing tests. Long-term we'd like to migrate the majority of these to fbp-spec, but this is not done in a day....
Most of these tests are written in Mocha+Chai. They usually either set up a NoFlo component by requiring it directly, or use Noflo.ComponentLoader (especially with sub/graphs). Component lifetime is sometimes done per testcase, and sometimes for the whole suite.
We also have some Mocha+Chai tests, which test on the MsgFlo participant level. And we sometimes have tests for plain (JavaScript) code used by NoFlo component, but which is not NoFlo?FBP...
To enable an easy, immediately useful and gradual migration to fbp-spec. It would be great if we could have a way to represent/enumerate, run and evalute plain-old-MochaChai tests as if they were fbp-spec.
The text was updated successfully, but these errors were encountered: