Running Test cases without cargo test?

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 :)

Steps:

  1. Fork
  2. build
  3. test

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.

Hope this clears some things up! :slightly_smiling_face:

1 Like

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

1 Like

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