# How to run added tests for new kibana custom plugins

**URL:** <https://discuss.elastic.co/t/how-to-run-added-tests-for-new-kibana-custom-plugins/247805>\
**Category:** Kibana\
**Created:** [September 7, 2020, 7:43pm UTC](https://discuss.elastic.co/t/how-to-run-added-tests-for-new-kibana-custom-plugins/247805 "2020-09-07T19:43:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![larryzhu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/larryzhu/32/53759_2.png) [@larryzhu](https://discuss.elastic.co/u/larryzhu)\
**Post date:** [September 7, 2020, 7:43pm UTC](https://discuss.elastic.co/t/how-to-run-added-tests-for-new-kibana-custom-plugins/247805/1 "2020-09-07T19:43:27Z")

</div>

I added a test in JS in kibana, how do I run it?

lazhu@lazhu-mac kibana % git status  
On branch 7.8  
Your branch is ahead of 'origin/7.8' by 1 commit.  
(use "git push" to publish your local commits)Changes not staged for commit:  
(use "git add ..." to update what will be committed)  
(use "git restore ..." to discard changes in working directory)  
modified: src/plugins/shard\_map/server/routes/index.ts  
modified: yarn.lockUntracked files:  
(use "git add ..." to include in what will be committed)  
src/plugins/shard\_map/public/components/app.test.jsno changes added to commit (use "git add" and/or "git commit -a")  
lazhu@lazhu-mac kibana % node scripts/jest app  
/Users/lazhu/proto/github/larryzhu2018/kibana/src/dev/jest/cli.js:25  
\_jest.default.run(process.argv.slice(2));  
^TypeError: Cannot read property 'run' of undefined

([https://proddev-saas.slack.com/archives/DJ1GZP77A/p1599507475001300](https://proddev-saas.slack.com/archives/DJ1GZP77A/p1599507475001300))

if I run "yarn test" it runs all the tests, and many of those fail so I could not get it to run my new tests.  
Is there a way to run just my app.test.js tests?

---

<div class="post-metadata">

**Author:** ![rashmi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rashmi/32/16391_2.png) [@rashmi](https://discuss.elastic.co/u/rashmi)\
**Post date:** [September 8, 2020, 5:31am UTC](https://discuss.elastic.co/t/how-to-run-added-tests-for-new-kibana-custom-plugins/247805/2 "2020-09-08T05:31:23Z")

</div>

Have you checked these links? It would be a good starting point

> [@How can i test my custom Kibana Plugin?](https://discuss.elastic.co/t/how-can-i-test-my-custom-kibana-plugin/97397/4):
>
> Most of our functional UI tests (Selenium tests) load test data into Elasticsearch using the es\_archiver For example, in this discover test it uses await esArchiver.load('discover'); Which is loading the set of data which is checked-in here; [https://github.com/elastic/kibana/tree/master/test/functional/fixtures/es\_archiver/discover](https://github.com/elastic/kibana/tree/master/test/functional/fixtures/es_archiver/discover) You can run the es\_archiver from the command line to save some data you created in Elasticsearch by whatever means you want. And then in your test you would …

> **[Developer guide | Kibana Guide \[master\] | Elastic](https://www.elastic.co/guide/en/kibana/master/development.html)**

Thanks  
Rashmi

---

<div class="post-metadata">

**Author:** ![larryzhu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/larryzhu/32/53759_2.png) [@larryzhu](https://discuss.elastic.co/u/larryzhu)\
**Post date:** [September 8, 2020, 5:21pm UTC](https://discuss.elastic.co/t/how-to-run-added-tests-for-new-kibana-custom-plugins/247805/3 "2020-09-08T17:21:55Z")

</div>

thanks. The following command from the developer link works for me:  
yarn test:jest --watch -t loading src/plugins/shard\_map/public/components/app.test.js

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 6, 2020, 5:21pm UTC](https://discuss.elastic.co/t/how-to-run-added-tests-for-new-kibana-custom-plugins/247805/4 "2020-10-06T17:21:57Z")

</div>

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