How to generate coverage report for grafana plugin on build command?

Hi,
I’m building panel plugin with ReactJs, and I’m using jest for testing, and also I need to generate a code coverage when I build the plugin.
First, Grafana tutorials are missing examples for developing full Grafana plugin, with tests and also beyond. I spend quiet long time trying to figure out all the dependencies needed for plugin tests to work properly. A full panel plugin example from scratch would with unit test framework samples would be a great help for newbies.

Now to my point:
My panel plugin is ready with the code and some tests, I have also package.json set with the scripts as following:

“scripts”: {
“build”: “grafana-toolkit plugin:build”,
“test”: “grafana-toolkit plugin:test --coverage”,
“dev”: “grafana-toolkit plugin:dev”,
“watch”: “grafana-toolkit plugin:dev --watch”
},

My goal is to have code coverage at the end of the build, so I have configured the jest.config.js to have the reporters and coverage reporters as following:

collectCoverage: true,
coverageReporters: [‘text’, ‘cobertura’],
collectCoverageFrom: [‘src//*.{ts,tsx}’, '!src/testSetup/’, ‘!/node_modules/’, ‘!/vendor/’],
reporters: [
‘default’,
[
‘jest-html-reporters’,
{
publicPath: ‘./coverage/html-report’,
filename: ‘code-coverage.html’,
expand: false,
},
],
],

When I run the comman ‘yarn test’ everything is as expected, I have the html-report, in addition to the cobertura xml format file created in place (since the --coverage flag is used in the ‘test’ script, as one can see in the scripts snippet from my package.json).
When I run the ‘yarn build’ then the tests are also executed, but the cobertura file is not generated. The grafana-toolkit plugin:build command runs the tests, it is generating the html-report, but not the coverageReporters.
I tried to change the build command in my package.json to be as following:

“build”: “grafana-toolkit plugin:test --coverage & grafana-toolkit plugin:build”,

This works as I expected and generated the files in place, but this executes the tests twice, as part of the plugin:test and then as part of the plugin:build, which is a waste of time.

Is there anyway I can make “build” generate the full coverage I want, or maybe make the “build” ignore tests, so I can run the tests before or after the build is done?
Or any other suggestions how I can get coverage as I expect with the “build” command?