The easiest way to test an automation is to use the test command. This command will run the automation locally, and print the output to the console. We invoke your automation with a mock event payload that corresponds to the event defined in the on decorator.

blocks test <relative-path-to-filename>

If your automation expects environment variables that are defined in the dashboard, in addition to non-configurable runtime injected variables that the repo or other modules expect, your automation will not have access to these during a test invocation and will expectedly fail.