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
Test threadArgumentsFilter ignored for process
bojavou committed Jul 22, 2024
commit e39f509a4f2aa21057920278117faa0f8c12fe72
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import test from 'ava';

test('exec arguments unfiltered', t => {
t.plan(2);
t.truthy(process.execArgv.includes('--throw-deprecation'));
t.truthy(process.execArgv.includes('--allow-natives-syntax'));
});
11 changes: 11 additions & 0 deletions test/node-arguments/snapshots/test.js.md
Original file line number Diff line number Diff line change
@@ -26,6 +26,17 @@ Generated by [AVA](https://avajs.dev).
},
]

## `threadArgumentsFilter` configuration ignored for worker process

> tests pass

[
{
file: 'process.js',
title: 'exec arguments unfiltered',
},
]

## detects incomplete --node-arguments

> fails with message
Binary file modified test/node-arguments/snapshots/test.js.snap
Binary file not shown.
10 changes: 10 additions & 0 deletions test/node-arguments/test.js
Original file line number Diff line number Diff line change
@@ -23,6 +23,16 @@ test('`threadArgumentsFilter` configuration filters arguments for worker thread'
t.snapshot(result.stats.passed, 'tests pass');
});

test('`threadArgumentsFilter` configuration ignored for worker process', async t => {
const options = {
cwd: cwd('thread-arguments-filter'),
};

const result = await fixture(['--config=thread-arguments-filter.config.mjs', '--no-worker-threads', 'process.js'], options);

t.snapshot(result.stats.passed, 'tests pass');
});

test('detects incomplete --node-arguments', async t => {
const options = {
cwd: cwd('node-arguments'),