How to test code that includes ports?

Hello all!

I am writing an Elm application, and I’d like to introduce some tests (written in Elm), to the codebase.

  • What libraries exist for this?
  • Are there options to use property-based testing in Elm?
  • Some parts of the library require ports having been set up from the JavaScript-side, and interacting with them. How to test these?
  • elm-test allows you to write both regular unit tests and property based tests
  • elm-html-test allows you to test Html values by checking for the presence of particular elements, counting elements and so on.
  • I also found elm-ordeal which allows you to test tasks.
1 Like

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