# How can I create a test harness for my Sway project?

**URL:** <https://forum.fuel.network/t/how-can-i-create-a-test-harness-for-my-sway-project/721>\
**Category:** Rust SDK\
**Tags:** faqs\
**Created:** [December 14, 2022, 10:19pm UTC](https://forum.fuel.network/t/how-can-i-create-a-test-harness-for-my-sway-project/721 "2022-12-14T22:19:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![camiinthisthang.sway](https://avatars.discourse-cdn.com/v4/letter/c/848f3c/32.png) [@camiinthisthang.sway](https://forum.fuel.network/u/camiinthisthang.sway)\
**Post date:** [December 14, 2022, 10:19pm UTC](https://forum.fuel.network/t/how-can-i-create-a-test-harness-for-my-sway-project/721/1 "2022-12-14T22:19:14Z")

</div>

It used to come standard when creating a new project with `forc new project_name` but now it doesn’t. How can I add tests?

---

<div class="post-metadata">

**Author:** ![camiinthisthang.sway](https://avatars.discourse-cdn.com/v4/letter/c/848f3c/32.png) [@camiinthisthang.sway](https://forum.fuel.network/u/camiinthisthang.sway)\
**Post date:** [December 14, 2022, 10:20pm UTC](https://forum.fuel.network/t/how-can-i-create-a-test-harness-for-my-sway-project/721/2 "2022-12-14T22:20:50Z")

</div>

Create a default test harness by running the following command: `cargo generate --init fuellabs/sway templates/sway-test-rs --name project_name`

---

<div class="post-metadata">

**Author:** ![mindtree](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/mindtree/32/5_2.png) [@mindtree](https://forum.fuel.network/u/mindtree)\
**Post date:** [December 15, 2022, 12:52am UTC](https://forum.fuel.network/t/how-can-i-create-a-test-harness-for-my-sway-project/721/3 "2022-12-15T00:52:52Z")

</div>

For a more detailed walk-through on Rust integration testing, [these docs](https://fuellabs.github.io/sway/v0.32.0/book/testing/testing-with-rust.html) might also be useful. _I’ve pinned that link to version 0.32.0 in case these docs get moved in the future._

---

<div class="post-metadata">

**Author:** ![fuel](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/fuel/32/1677_2.png) [@fuel](https://forum.fuel.network/u/fuel)\
**Post date:** [December 15, 2022, 1:53pm UTC](https://forum.fuel.network/t/how-can-i-create-a-test-harness-for-my-sway-project/721/4 "2022-12-15T13:53:26Z")

</div>

You can read more about testing here  
[https://fuellabs.github.io/sway/v0.32.1/book/testing/index.html](https://fuellabs.github.io/sway/v0.32.1/book/testing/index.html)

---

<div class="post-metadata">

**Author:** ![camiinthisthang.sway](https://avatars.discourse-cdn.com/v4/letter/c/848f3c/32.png) [@camiinthisthang.sway](https://forum.fuel.network/u/camiinthisthang.sway)\
**Post date:** [January 26, 2023, 7:25pm UTC](https://forum.fuel.network/t/how-can-i-create-a-test-harness-for-my-sway-project/721/5 "2023-01-26T19:25:42Z")

</div>

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