# Building with Bazel, Episode 15: Run Unit Tests | Kodeco

**URL:** <https://forums.kodeco.com/t/building-with-bazel-episode-15-run-unit-tests-kodeco/184848>\
**Category:** 🎓 Courses & Articles\
**Created:** [March 7, 2023, 4:24pm UTC](https://forums.kodeco.com/t/building-with-bazel-episode-15-run-unit-tests-kodeco/184848 "2023-03-07T16:24:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vegetarianzombie](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/vegetarianzombie/32/94022_2.png) [@vegetarianzombie](https://forums.kodeco.com/u/vegetarianzombie)\
**Post date:** [March 7, 2023, 4:24pm UTC](https://forums.kodeco.com/t/building-with-bazel-episode-15-run-unit-tests-kodeco/184848/1 "2023-03-07T16:24:04Z")

</div>

Learn how to define unit tests in your Build file and then how to run your tests using Bazel.

* * *
This is a companion discussion topic for the original entry at [https://www.kodeco.com/31558158-building-with-bazel/lessons/15](https://www.kodeco.com/31558158-building-with-bazel/lessons/15)

---

<div class="post-metadata">

**Author:** ![deepanshugautam09](https://s3.amazonaws.com/cdn.raywenderlich.com/community/forum-assets/noun-game-ghost-878668.png) [@deepanshugautam09](https://forums.kodeco.com/u/deepanshugautam09)\
**Post date:** [March 7, 2023, 4:57pm UTC](https://forums.kodeco.com/t/building-with-bazel-episode-15-run-unit-tests-kodeco/184848/2 "2023-03-07T16:57:33Z")

</div>

On building the tests, getting error:

```auto
ERROR: /Users/deepanshugautam/personal/build_tools/bazel/BazelBuild/Bullseye-iOS/BUILD:34:14: Compiling Swift module //Bullseye-iOS:tests failed: (Exit 1): worker failed: error executing command (from target //Bullseye-iOS:tests) bazel-out/darwin_arm64-opt-exec-2B5CBBC6-ST-521287fc850f/bin/external/build_bazel_rules_swift/tools/worker/worker swiftc ... (remaining 1 argument skipped)
error: emit-module command failed with exit code 1 (use -v to see invocation)
Bullseye-iOS/BullseyeTests/BullseyeTests.swift:8:8: error: no such module 'XCTest'
import XCTest
       ^
Bullseye-iOS/BullseyeTests/BullseyeTests.swift:8:8: error: no such module 'XCTest'
import XCTest
       ^

```

---

<div class="post-metadata">

**Author:** ![kpere](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/kpere/32/109586_2.png) [@kpere](https://forums.kodeco.com/u/kpere)\
**Post date:** [August 4, 2023, 11:12am UTC](https://forums.kodeco.com/t/building-with-bazel-episode-15-run-unit-tests-kodeco/184848/3 "2023-08-04T11:12:45Z")

</div>

Thank you @deepanshugautam09 for reaching out and sharing the error in your code. We appreciate your engagement with the community for the first time. Rest assured, we’ll address your question shortly and provide assistance. Stay tuned for the response! @vegetarianzombie
