Automated tests

Write automated tests to ensure your logic rules behave as expected.

Once you have created a logic rule, you may navigate to the Tests tab of the rule to set up automated tests for the rule that automatically run in an isolated environment when the form is published. If any test fails, the form will fail to publish.

For each of the tests, you'll want to specify:

  • A unique test name

  • The initial field values before the logic rule is run, formatted in a JSON object where the key is the field ID and the value is the initial value of the field.

  • The expected state of field values after the logic rule is run, similarly formatted in a JSON object.

Note that any network request or method on the feathery global object that's called from your logic rule will not actually run during the test and will simply be stubbed out.

Having comprehensive tests for your logic rules will allow you to be confident in the updates you make to your form while not needing to fall back on time-consuming manual validation for rule-related changes.

Last updated

Was this helpful?