In the project directory, open in LightTable:
ModuleName.jl
with functions under development (Capitalize jl-file names containing modules, match file and module names)usingfile.jl
that doesinclude("ModuleName.jl")
(which allows reloading without Julia restart, see FAQ)
In the ./test/
sub-directory, put the file with FactCheck tests for ModuleName
functions: collect all tests into one file named modulename.jl
, i.e. the same as source but without capitalization and residing in the testing sub-directory. Open it in LightTable as well.
- Open a terminal with interactive Julia REPL in the project directory
using FactCheck
include("ModuleName.jl"); include("./test/modulename.jl")
Proceed with the TDD write test, fail, edit code, pass workflow re-running the last steps above after code edits. IMPORTANT: always remember to reload the module after edits, include("ModuleName.jl")
(hence 2 commands are chained in step 3 above). Otherwise tests will apply to the previously loaded version. Seems obvious but easy to skip my mistake in practice.