Comment on page
How to test your Derw code
To run tests, run `derw test` from the package directory
To watch use the --watch flag
--watch : Watch Derw files for changes
--function string: A particular function name to run
--file string: A particular file name to run
--only-fails : Only log failing tests
-h, --help : This help text
Your file must have the extension
_test.derwto be picked up by the test runner.
Testing functions are provided by the stdlib, which you can install via:
derw install --name derw-lang/stdlib --version main
These can then be imported like
import "./Test" exposing ( equals, notEquals )
A test function should be called
testNameOfTest, and have the type
a -> void. Test functions are automatically exported by the compiler.
testEmptySplit: a -> void
split "," ""
|> equals [ "" ]
testSplit: a -> void
split "," "a,b,c"
|> equals [
When working with html, you may find yourself needing to test a repeated set of actions in the browser - and ensuring the correct data shows up. This can be done via html-test package. It provides both a html element you can embed for results, and a console output. It is currently a work in progress, but if you're curious you can try it out.