# Running Test cases without cargo test?

**URL:** <https://forum.fuel.network/t/running-test-cases-without-cargo-test/3898>\
**Category:** General\
**Tags:** feedback\
**Created:** [December 25, 2023, 5:15pm UTC](https://forum.fuel.network/t/running-test-cases-without-cargo-test/3898 "2023-12-25T17:15:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nambi](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/nambi/32/2011_2.png) [@Nambi](https://forum.fuel.network/u/Nambi)\
**Post date:** [December 25, 2023, 5:15pm UTC](https://forum.fuel.network/t/running-test-cases-without-cargo-test/3898/1 "2023-12-25T17:15:30Z")

</div>

I’m new to Fuel and I wrote my first smart contract. It built just fine, but the two test cases took ages (\>15 mins) to pass successfully. I’m attaching the repository link. I’m hoping either I’m doing something wrong or this is some known issue being fixed. I was wondering if there’s another way to run unit tests.

Link: [GitHub - harshnambiar/hello\_sway: Your first smart contract on the FUEL Network, written in Sway language :)](https://github.com/harshnambiar/hello_sway)

Steps:

1. Fork
2. build
3. test

---

<div class="post-metadata">

**Author:** ![calldelegation](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/calldelegation/32/1484_2.png) [@calldelegation](https://forum.fuel.network/u/calldelegation)\
**Post date:** [December 25, 2023, 6:00pm UTC](https://forum.fuel.network/t/running-test-cases-without-cargo-test/3898/2 "2023-12-25T18:00:04Z")

</div>

Hey @Nambi, happy holidays! I just tested your repository. During the first run of `cargo test`, you have to download all dependencies. The compiling time is likely dependent on your hardware and internet speeds. Subsequent `cargo test` runs should be much faster, provided you don’t change your dependency versions, like upgrading `fuels-rs`.

You can also write your unit tests in Sway directly within your code. Check out this section of our guides for more information: [Sway Testing Guide](https://docs.fuel.network/docs/sway/testing/unit-testing/).

Hope this clears some things up! 🙂

---

<div class="post-metadata">

**Author:** ![Nambi](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/nambi/32/2011_2.png) [@Nambi](https://forum.fuel.network/u/Nambi)\
**Post date:** [December 25, 2023, 6:12pm UTC](https://forum.fuel.network/t/running-test-cases-without-cargo-test/3898/3 "2023-12-25T18:12:35Z")

</div>

Beautiful. forc test was exactly what I was looking for. Merry Christmas!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/fuel/original/2X/5/57d5a345cc15a64b636e0d56e042857f8a0e80b1.png) [@system](https://forum.fuel.network/u/system)\
**Post date:** [January 15, 2024, 2:13pm UTC](https://forum.fuel.network/t/running-test-cases-without-cargo-test/3898/4 "2024-01-15T14:13:30Z")

</div>

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