Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

A Testing story would be useful #48

Open
kastork opened this issue Nov 28, 2017 · 1 comment
Open

A Testing story would be useful #48

kastork opened this issue Nov 28, 2017 · 1 comment

Comments

@kastork
Copy link

kastork commented Nov 28, 2017

I realized today there's really not a story about testing in the context of TornadoFx contained in the guide.

For example, I wanted to start an app by building kotlin-test specs to call and integrate domain objects against a public Restful API using the TornadoFx Rest capability. But then I discover that Rest is a TornadoFx controller and there's no obvious way to instantiate one for the purposes of testing (by inject isn't really something you can do in a test class (or is it?)).

I'm sure there are many other situations where a discussion of how to do testing would be beneficial to many users.

@edvin
Copy link
Owner

edvin commented Nov 28, 2017

This would be very helpful. You can get a Component instance by calling FX.find<ComponentType>() at any time, it has the same effect as injection. In a pinch you can even instantiate it manually and call init(), but that's not going to work if you're utilizing scopes.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants