Workflows are full of complex code which would really benefit from unit testing. Unit testing individual functions in job code would improve maintainability, increase confidence in the accuracy/robustness of the code, and be a helpful way of actually writing those functions (ie, test driven development)
It would also be desirable to take some mock input data, pass it into the workflow, and make assertions about the resulting final state. Ie, an integration test against the whole suite.
Tests would be defined probably as JS files somewhere in the project, and referenced in workflow json (the CLI doesn’t yet know about a project as a file structure, so it can’t discover tests very well).
The CLI would have a test
command - ie openfn test workflow.json
, which would discover any tests associated with that workflow, run them, and show the output.