gritql icon indicating copy to clipboard operation
gritql copied to clipboard

Watch mode for `grit patterns test`

Open morgante opened this issue 3 months ago • 9 comments

We would like to have a watch mode for grit patterns test --watch.

Watch mode should be similar to other testing/CLI tools that offer a watch mode: when files change, re-run tests.

Acceptance criteria

  • Watch mode should watch for file changes to any patterns in the .grit directory and automatically re-run those tests
  • If a file changes, only the affected patterns should be re-run. Ex. if I edit this file then only that pattern test should re-run.
  • You will also need to account for pattern dependencies. Ex. if https://github.com/getgrit/stdlib/blob/main/.grit/patterns/js/imports.grit is edited then any patterns which use the ensure_import_from pattern should be re-run. Utilities like this can be leveraged for walking the call graph
  • At least 2 tests should be included, including ideally at least one integration test of the final binary like we do here.

morgante avatar Mar 22 '24 03:03 morgante