--- url: "https://asyncapi.com/docs/tools/generator/development-testing" titulek: "Community - Testing | AsyncAPI Initiative for event-driven APIs" h1: "Community - Testing" popis: "How to run and add tests for the generator. For local setup see Development setup. Running Tests Locally To run all tests locally: Unit tests: npm run generator:test:unit Integration tests: npm run" jazyk: "en" kanonicka: "" drobecky: [] zdroj: "live" wayback_snapshot: "" stazeno: "2026-09-14 02:46:20" znaku: 2610 slov: 328 kodovani: "utf-8" sha256: "c6d0e3f40b527674272e7bf1de7f38aff619dd8aae42e3a7bcd68357b4366419" --- ##### On this page Running Tests Locally Adding tests Running Tests in Docker Manually testing with test templates # Community - Testing Found an error? Have a suggestion?[Edit this page on GitHub](https://github.com/asyncapi/generator/tree/master/apps/generator/docs/development-testing.md) How to run and add tests for the generator. For local setup see [Development setup](/docs/tools/generator/development-setup). ### Running Tests Locally To run all tests locally: - Unit tests: `npm run generator:test:unit` - Integration tests: `npm run generator:test:integration` ### Adding tests 1. Create new test files in the appropriate directory under `apps/generator/test/`. 2. Follow the existing test patterns. 3. Run your new tests using the commands listed above. ## Running Tests in Docker To run tests in an isolated Docker environment: 1. Ensure Docker is installed and running on your machine, with **Docker Compose v2** (the `docker compose` command, not the legacy `docker-compose` v1). The Compose configuration files use the `pull_policy` key, which is only supported by Compose v2. 2. Run the following command from the project root: ``` docker compose up ``` You can also choose to run the lint checks after the tests complete by setting an environment variable `LINT` with any value before the command: - Windows: `set LINT=true && docker compose up` - Linux/macOS: `LINT=true docker compose up` > This approach ensures a clean environment for each test run by cleanly installing dependencies and running tests in a Docker container. ### Manually testing with test templates To test template features manually, use the `react-template` located in `apps/generator/test/test-templates`. You can run your changes against this template as follows: 1. Navigate to the generator directory: ``` cd apps/generator ``` 1. Modify the react-template in `./test/test-templates/react-template` to test different features. 2. Run the generator against the the test template: ``` node ./test/cli ./test/docs/dummy.yml ./test/test-templates/react-template -o ./test/output --force-write ``` 1. Check the `./test/output` directory to confirm it matches the output you expected. [Go BackCommunity - Development setup](/docs/tools/generator/development-setup) [Up NextCommunity - Release process](/docs/tools/generator/release-process) Was this helpful? Help us improve the docs by sharing your feedback. [Submit Feedback](https://github.com/asyncapi/website/issues/new?template=docs-feedback.yml&title=Docs%20Feedback%3A%20%2Fdocs%2Ftools%2Fgenerator%2Fdevelopment-testing&labels=%F0%9F%93%91%20docs) OR [Create Issue on GitHub](https://github.com/asyncapi/website/issues/new/choose)