Skip to content

Commit 157495b

Browse files
authored
Merge pull request #5616 from segmentio/lizkane222-patch-29
Update environment.md Testing a function section
2 parents 626ecd0 + ce4ffe7 commit 157495b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/connections/functions/environment.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,19 @@ If you're editing an existing function, you can **Save** changes without changin
3535

3636
You can also choose to **Save & Deploy** to push changes to all, or specific functions in your workspace that are already deployed. You might need additional permissions to deploy these changes.
3737

38+
## Testing a function
39+
You have the option to test your functions code with either a sample event or by loading a default event that you can customize yourself.
40+
* **Sample event**: When you click **Test with custom event** you can select a sample event from any of your workspace sources to test this function.
41+
* **Customize the event yourself**: When you click **customize the event yourself** a default event payload loads which you can modify with the desired data. You have the option to paste in a JSON event or click **Manual Mode** and type in the fields manually. If you'd like to locate a recent event from a source that's not available by following the sample event instruction:
42+
1. Navigate to the source debugger.
43+
2. Click the event you want to test and copy the raw JSON payload.
44+
3. Paste the raw JSON payload into your Function Editor.
45+
46+
Once the payload you want to test is ready, click **Run**.
47+
48+
> info ""
49+
> If you create settings in your function, then you need to fill in the setting values before clicking **Run**.
50+
3851
## Deploying source functions
3952

4053
> note ""

0 commit comments

Comments
 (0)