# Konfiguration JEST-Unit Test

**URL:** <https://forum.shopware.com/t/konfiguration-jest-unit-test/96640>\
**Category:** Programmierung\
**Created:** [12. Oktober 2022 um 06:25 UTC](https://forum.shopware.com/t/konfiguration-jest-unit-test/96640 "2022-10-12T06:25:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rammi22](https://avatars.discourse-cdn.com/v4/letter/r/258eb7/32.png) [@rammi22](https://forum.shopware.com/u/rammi22)\
**Post date:** [12. Oktober 2022 um 06:25 UTC](https://forum.shopware.com/t/konfiguration-jest-unit-test/96640/1 "2022-10-12T06:25:09Z")

</div>

Hallo,

Repository: [Shopware Platform](https://github.com/shopware/platform)  
OS: Ubuntu 22.04  
Docker: 20.10.18

Ich suche eine Anleitung oder Tutorial für das Setup / die Konfiguration für JEST unit tests für [custom component](https://developer.shopware.com/docs/guides/plugins/plugins/administration/add-custom-component).

In den Dokumentationen finde ich nur, wie unit tests geschrieben werden, aber keine Anleitung wie das Test-System eingerichtet wird.

Mit dem Befehl `swdc admin-jest my-project` kann ich alle default Tests abfahren, aber wie kann ich meine Plugin-Tests ausführen?

---

<div class="post-metadata">

**Author:** ![rammi22](https://avatars.discourse-cdn.com/v4/letter/r/258eb7/32.png) [@rammi22](https://forum.shopware.com/u/rammi22)\
**Post date:** [13. Oktober 2022 um 16:51 UTC](https://forum.shopware.com/t/konfiguration-jest-unit-test/96640/2 "2022-10-13T16:51:15Z")

</div>

Ich habe keine ultimative Antwort gefunden. Deshalb versuche mich mal mit einem kleinen Tutorial.

Der Code und die Anleitung ist erreichbar bei:  
[GitLab „Shopware 6 (shopware-docker): Setup JEST unit test for custom plugins“](https://gitlab.com/rammi2211/setup-jest-automated-testing-custom-plugins-using-shopware-docker/-/tree/master)

Das Tutorial umfasst die **Installation** / das **Setup** für [Jest unit test](https://jestjs.io/) und führt ein einfachen Test-Beispiel mit **bekannten Fehlern** und möglichen **Lösungen**.

Entweder

- Test direkt ausführen mit angebotenen Code ( **auf eigenes Risiko** )
  - [download vom **master** (!) branch](https://gitlab.com/rammi2211/setup-jest-automated-testing-custom-plugins-using-shopware-docker/-/tree/master) und installiere Plugin in deinem Projekt

- oder **entwickle ein eigenes plugin** mit der [**STEP BY STEP**](https://gitlab.com/shopware-develop/setup-jest-automated-testing-for-custom-plugins-using-shopware-docker/-/tree/master#step-by-stepinstallation-setup-jest) Anleitung.
