# What are the best tools to test canisters written in Motoko. What I‘ve tried so far is surprisingly big of a pain

**URL:** <https://forum.dfinity.org/t/what-are-the-best-tools-to-test-canisters-written-in-motoko-what-i-ve-tried-so-far-is-surprisingly-big-of-a-pain/16474>\
**Category:** Developers\
**Tags:** Discussing\
**Created:** [November 10, 2022, 1:27am UTC](https://forum.dfinity.org/t/what-are-the-best-tools-to-test-canisters-written-in-motoko-what-i-ve-tried-so-far-is-surprisingly-big-of-a-pain/16474 "2022-11-10T01:27:04Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![paulyoung](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/paulyoung/32/5251_2.png) [@paulyoung](https://forum.dfinity.org/u/paulyoung)\
**Post date:** [November 10, 2022, 2:41am UTC](https://forum.dfinity.org/t/what-are-the-best-tools-to-test-canisters-written-in-motoko-what-i-ve-tried-so-far-is-surprisingly-big-of-a-pain/16474/2 "2022-11-10T02:41:01Z")

</div>

I think these are some good resources:

> **[Unit Testing in Motoko](https://kyle-peacock.com/blog/motoko/unit-testing/)**
>
> Some early lessons learned from unit testing a Motoko canister

> [@Motoko: How to write unit tests?](https://forum.dfinity.org/t/motoko-how-to-write-unit-tests/3463/3):
>
> We are still experimenting with the best way to test Motoko and canisters. There are several tools around today that can help with unit testing: Built-in assert: see examples from the base library: [motoko-base/test at master · dfinity/motoko-base · GitHub](https://github.com/dfinity/motoko-base/tree/master/test) The Motoko matcher library: [GitHub - kritzcreek/motoko-matchers](https://github.com/kritzcreek/motoko-matchers). It’s best to test with library code, i.e. without service actors. ic-repl: [GitHub - chenyan2002/ic-repl](https://github.com/chenyan2002/ic-repl). This is designed at the canister level, so that you can use the tool to…

> [@Motoko: How to write unit tests?](https://forum.dfinity.org/t/motoko-how-to-write-unit-tests/3463/10):
>
> In addition to the approaches listed by @chenyan above, there is also the approach to use the ic-hs IC simulator as a library, and use Haskell to script the testing of the compiled canister. As it works with the compiled wasm, it works with both Motoko and Rust canisters. This is the approach chosen by the Internet Identity project:

---

_[View the full topic](https://forum.dfinity.org/t/what-are-the-best-tools-to-test-canisters-written-in-motoko-what-i-ve-tried-so-far-is-surprisingly-big-of-a-pain/16474)._
