From fdb229b8d4b3ea6b4107743977181a0be90a16b5 Mon Sep 17 00:00:00 2001 From: bojavou <134245276+bojavou@users.noreply.github.com> Date: Mon, 22 Jul 2024 23:42:02 +0000 Subject: [PATCH] Document threadArgumentsFilter --- docs/06-configuration.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/06-configuration.md b/docs/06-configuration.md index 31531fe29..622c6579e 100644 --- a/docs/06-configuration.md +++ b/docs/06-configuration.md @@ -337,3 +337,18 @@ These may also export a function which is then invoked, and can receive argument The `nodeArguments` configuration may be used to specify additional arguments for launching worker processes. These are combined with `--node-arguments` passed on the CLI and any arguments passed to the `node` binary when starting AVA. [CLI]: ./05-command-line.md + +## Thread arguments filter + +In a config file only, `threadArgumentsFilter` may provide a function used for filtering `nodeArguments` sent to worker threads. This enables excluding arguments that throw if sent to a thread. The filter is ignored by worker processes. + +```js +const processOnly = new Set([ + '--allow-natives-syntax', + '--expose-gc' +]); + +export default { + threadArgumentsFilter: argument => !processOnly.has(argument) +} +```