# How do I test my Sway contract?

**URL:** <https://forum.fuel.network/t/how-do-i-test-my-sway-contract/97>\
**Category:** Sway\
**Tags:** faqs\
**Created:** [December 5, 2022, 7:04pm UTC](https://forum.fuel.network/t/how-do-i-test-my-sway-contract/97 "2022-12-05T19:04:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sarah](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/sarah/32/13_2.png) [@sarah](https://forum.fuel.network/u/sarah)\
**Post date:** [December 5, 2022, 7:04pm UTC](https://forum.fuel.network/t/how-do-i-test-my-sway-contract/97/1 "2022-12-05T19:04:30Z")

</div>

You can test Sway contracts with the Fuels Rust SDK or TypeScript SDK. You can find examples in the official docs below:

[https://fuellabs.github.io/fuels-rs/](https://fuellabs.github.io/fuels-rs/)

> **[Home](https://fuellabs.github.io/fuels-ts/)**
>
> Fuel v2 TypeScript SDK

---

<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 8, 2022, 3:09am UTC](https://forum.fuel.network/t/how-do-i-test-my-sway-contract/97/2 "2022-12-08T03:09:32Z")

</div>

I’ll add that there are plans to support testing contract calls from Sway’s in-language unit testing too:

> <https://github.com/FuelLabs/sway/issues/3262>
>
> When unit tests are written within a contract module, it would be great if the u…ser could run the test assuming the contract is "deployed" and can be interacted with.
> 
> We could either make this the default behaviour for contract unit tests, or we could add a special nested attribute like \`#\[test(script)\]\` or \`#\[test(with\_contract)\]\` or similar.
> 
> We could provide the contract's ID in a similar manner to how we provide contract dependency IDs.
> 
> This will require a slightly more sophisticated testing setup in \`forc-test\`. Currently, we construct our own \`fuel-vm\` \`Interpreter\` and execute unit tests directly as if they were a script.
> 
> Calling into contracts will instead require first \*deploying\* the contract and then interacting with the contract from a script via a client.
> 
> This is an updated version of the #1832 issue, but specifically for supporting calling into contracts following landing #2985.

This is currently WIP, but is one of the Sway tooling team’s top priorities at the moment.
