# Unit test with external module

**URL:** <https://ziggit.dev/t/unit-test-with-external-module/4278>\
**Category:** Help\
**Tags:** build-system, testing\
**Created:** [May 11, 2024, 4:09pm UTC](https://ziggit.dev/t/unit-test-with-external-module/4278 "2024-05-11T16:09:20Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![dimdin](https://ziggit.dev/user_avatar/ziggit.dev/dimdin/32/1457_2.png) [@dimdin](https://ziggit.dev/u/dimdin)\
**Post date:** [April 22, 2026, 7:14pm UTC](https://ziggit.dev/t/unit-test-with-external-module/4278/4 "2026-04-22T19:14:19Z")

</div>

Hello @rotiv, welcome to ziggit.

The easy way is to run `zig build test` from zed tasks (the task definition is included in the zig extension).  
For this to work you need to have a `build.zig` that defines the `test` step. The example code in [Build System Tricks](https://ziggit.dev/t/build-system-tricks/3531#p-12644-h-4-run-your-test-suite-exposed-with-stdtestingrefalldecls-19) runs the tests in the `root_source_file`.

---

_[View the full topic](https://ziggit.dev/t/unit-test-with-external-module/4278)._
