Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add filterNodeArgumentsForWorkerThreads option #3336

Merged
merged 14 commits into from
Aug 20, 2024
Prev Previous commit
Next Next commit
Document threadArgumentsFilter
  • Loading branch information
bojavou committed Jul 22, 2024
commit fdb229b8d4b3ea6b4107743977181a0be90a16b5
15 changes: 15 additions & 0 deletions docs/06-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
This conversation was marked as resolved.
Show resolved Hide resolved
const processOnly = new Set([
'--allow-natives-syntax',
'--expose-gc'
]);

export default {
threadArgumentsFilter: argument => !processOnly.has(argument)
This conversation was marked as resolved.
Show resolved Hide resolved
}
```
Loading