Kibana Plugin App Testing Problem

Hello there,
I have a problem with my Kibana Plugin App and I would really love to get some help.

I am trying to write some tests for my Plugin, but I'm hitting a brick wall.
I'm using version 6.2.3 of Kibana and I've developed my plugin using this plugin template generator .
My Plugin works like a charm, but when I try to run
npm run test:server
for example, I get this error
> plugin-helpers test:server

module.js:471
throw err;
^

Error: Cannot find module '/kibana-projects/kibana/test/mocha_setup.js'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at /kibana-projects/kibana/node_modules/mocha/bin/_mocha:346:3
at Array.forEach (native)
at Object.<anonymous> (/kibana-projects/kibana/node_modules/mocha/bin/_mocha:345:10)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:383:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:496:3
child_process.js:496
throw err;
^

I've been trying to find information about how to set up very simple tests, like for testing the routes of my app or the controller functions but I can't find anything so far.
Could you please help me out with this problem and point me in the right direction?

Thanks in advance!

where are you running npm run test:server?

In my Plugin's directory.

npm run test:server can only be run from the top level kibana directory.

If I run npm run test:server from the kibana directory, it runs all tests for the kibana itself. What I want is to run just the tests for my Plugin. Is this possible?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.