Skip to content
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

Export plugin mocks #38679

Closed
mshustov opened this issue Jun 11, 2019 · 4 comments
Closed

Export plugin mocks #38679

mshustov opened this issue Jun 11, 2019 · 4 comments
Assignees
Labels
chore Feature:New Platform Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc

Comments

@mshustov
Copy link
Contributor

mshustov commented Jun 11, 2019

At the moment we export only mock for core services. Plugin authors have to combine them manually to be able to use in tests.


src/core/public/mocks and src/core/server/mocks should export mocks for CoreSetup & CoreStart interfaces ready to use in their plugins.

@mshustov mshustov added chore Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Feature:New Platform labels Jun 11, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-platform

@joshdover
Copy link
Contributor

By this you mean, export a CoreSetupMock and CoreStartMock right?

@mshustov
Copy link
Contributor Author

@toddself
Copy link
Contributor

Having just gotten the setup working for a plugin to mock some of the various services that the plugins consume this is a definite +1 from me.

We also likely need to create an PluginInitializerContext mock -- the config interface provided on that object was the most difficult/labor intensive to build.

This is what I ended up on: https://github.com/elastic/kibana/blob/cc2b393f9095c7af25758969bdc91e43d6c29533/x-pack/plugins/proxy/server/cluster_doc.test.ts#L23-L56

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Feature:New Platform Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Projects
None yet
Development

No branches or pull requests

6 participants