Skip to main content
Skip to Content

The hooks file lists the scripts your tests can run. Its path is workspace.hooksFile, hooks.yaml by default. It must exist; a project without hooks uses hooks: []. Hooks explains when hooks run and how they pass values to tests.

hooks:
  - id: h_phi-arts-vis-band-aira-streng-twig-roi-mino-fold
    name: Make a shipping address
    runtime: node
    file: scripts/examples/make-shipping-address.mjs
    timeout: 30s
    network: false

id

How tests refer to the hook in setup, teardown and {{runHook:"…"}}. IDs must be unique.

Values
h_ followed by ten lowercase words joined by hyphens.
Required
Required
Default
none. The dashboard's hook editor and agent_qa_change_config create it.

name

The name shown in logs and in the dashboard.

Values
any text, unique in the file.
Required
Required
Default
none.

runtime

What runs the script. Each has its own sandbox image.

Values
nodebunpythonbash
Required
Required
Default
none.

file

The script to run.

Values
a path from the config file's folder.
Required
Required
Default
none.

deps

Extra files to copy next to the script, such as helper modules or test data.

Values
a list of paths.
Required
Optional
Default
none.

packageFile

A package manifest to copy next to the script. Nothing is installed from it.

Values
a path.
Required
Optional
Default
none.

timeout

How long the hook may run. A hook that runs past it fails.

Values
a duration, such as 30s or 2m.
Required
Required
Default
none.

network

Whether the sandbox has network access. Set false for hooks that only compute values.

Values
truefalse
Required
Optional
Default
true.