logo

Generating a local test

Make sure your function is published with hypar publish, and add it to a workflow in the Hypar web UI. Make note of the workflow ID β€” the part of the URL after hypar.io/workflows/
Then, in the local function folder run, substituting your workflow ID:
plain text
hypar test generate --workflow-id=YOUR_WORKFLOW_ID
This will create a unit test for your function using the inputs from the workflow, and download any models your function depends on. Find the test inside your function folder, under /test/Generated.
You can start to debug the test in the usual ways for your editor, which in VSCode is normally by clicking the small Debug Test button above your test. Then, you should be able to step through debug, stopping at exceptions and breakpoints you specify.
Image without caption

Troubleshooting

If you don't see these options, make sure you have the C# visual studio code extension installed, and try restarting VS Code. If it still doesn't show up, try running OmniSharp: Select Project from the command palette:
Image without caption
and be sure to select the .sln, rather than any of the .csproj files:
Image without caption