Running tests for plugins

I am trying to figure out how to run a test for a plugin. For instance, how do I run the test for the kairosdb datasource found in plugin/kairos/specs/kairosdb-datasource-specs.ts? Does this file need to be copied somewhere else? Can someone give me a clue as to how to run it?

The reason why you cannot figure out how to run the tests in the KairosDB here is that you can’t. KairosDB was moved out of the Grafana core project and the tests are from then. Looking at the package.json file, it is missing packages for Karma and Mocha. There is no karma conf file and no grunt task for running them.

I can help out here with getting the tests running (will send in a PR for that). Are you thinking of contributing to the KairosDB plugin? It looks like it needs some love.

Thanks for your reply! Sadly, I am not thinking of contributing to the KairosDB plugin, I am simply using it as an example for a plugin I am writing. Is there another plugin that has running tests that I can use as a model?

Are you going to write it in JavaScript, ES6 or TypeScript? (So many options these days :slight_smile: )

I am going to use JavaScript.

@squeakydog did you realize how to do it? I’m facing the same situation. Thank you