<p>I find that using the plutus PAB simulator is the best way to first test out your smart contract.   Once you confirm the smart contract logic is correct, you then move on to a local dev environment using cardano-cli to deploy your smart contract and run transactions against it.   Finally, once that is working, then you are ready for testnet testing which can be done either via the cardano-cli or through javascript wallet integration via Cardano serialization library.  This has been my experience to date and it will most likely be improved and be streamlined over time.</p>
<p>You can checkout my repo for some code examples and tips and trick I used for the PAB simulator, devnet and testnet testing.</p>
<p><a href="https://github.com/lley154/cardano-lottery" rel="nofollow noreferrer">https://github.com/lley154/cardano-lottery</a></p>

CC BY-SA 4.0
2022-06-16T20:48:14.450Z
2022-06-16T20:48:14.450Z
lley154
<p>I'm from EVM background and I've started learning about Cardano lately. I was just wondering how do I write unit tests for my smart-contract written in Haskell? Since i've been doing unit testing in javascript for solidity, using mocha/chai. Can I use javascript here aswell for uint tests?</p>
<p>TIA!</p>

<plutus><haskell><unit-test>
How do I test my smart-contract on Cardano
# How do I test my smart-contract on Cardano

(Asked by: username_0 on 2022-06-15)

I'm from EVM background and I've started learning about Cardano lately. I was just wondering how do I write unit tests for my smart-contract written in Haskell? Since i've been doing unit testing in javascript for solidity, using mocha/chai. Can I use javascript here aswell for uint tests?

TIA!

**Tags:** plutus, haskell, unit-test

---

## 1 answers

### Answer by username_1 on 2022-06-16. Score: 2

I find that using the plutus PAB simulator is the best way to first test out your smart contract. Once you confirm the smart contract logic is correct, you then move on to a local dev environment using cardano-cli to deploy your smart contract and run transactions against it. Finally, once that is working, then you are ready for testnet testing which can be done either via the cardano-cli or through javascript wallet integration via Cardano serialization library. This has been my experience to date and it will most likely be improved and be streamlined over time.

You can checkout my repo for some code examples and tips and trick I used for the PAB simulator, devnet and testnet testing.

<https://github.com/lley154/cardano-lottery>


---

