Skip to content

Commit 9d7ca3a

Browse files
Copilotdmichon-msft
andcommitted
Ensure all parameter types are tested for filtering
Co-authored-by: dmichon-msft <26827560+dmichon-msft@users.noreply.github.com>
1 parent 8746139 commit 9d7ca3a

3 files changed

Lines changed: 16 additions & 7 deletions

File tree

libraries/rush-lib/src/logic/operations/test/ShellOperationRunnerPlugin.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -260,16 +260,16 @@ describe(ShellOperationRunnerPlugin.name, () => {
260260
expect(commandHashA).toContain('--mode');
261261
expect(commandHashA).toContain('--tags');
262262

263-
// Verify that project 'b' has all parameters (no filtering)
263+
// Verify that project 'b' has --verbose, --config, --mode, and --tags filtered out
264264
const operationB = Array.from(operations).find((op) => op.name === 'b');
265265
expect(operationB).toBeDefined();
266266
const commandHashB = operationB!.runner!.getConfigHash();
267-
// Should contain all parameters since no filtering is configured
267+
// Should contain --production but not the other parameters since they are filtered
268268
expect(commandHashB).toContain('--production');
269-
expect(commandHashB).toContain('--verbose');
270-
expect(commandHashB).toContain('--config');
271-
expect(commandHashB).toContain('--mode');
272-
expect(commandHashB).toContain('--tags');
269+
expect(commandHashB).not.toContain('--verbose');
270+
expect(commandHashB).not.toContain('--config');
271+
expect(commandHashB).not.toContain('--mode');
272+
expect(commandHashB).not.toContain('--tags');
273273

274274
// All projects snapshot
275275
expect(Array.from(operations, serializeOperation)).toMatchSnapshot();

libraries/rush-lib/src/logic/operations/test/__snapshots__/ShellOperationRunnerPlugin.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Array [
77
"name": "a",
88
},
99
Object {
10-
"commandToRun": "echo building b --production --verbose --config /path/to/config.json --mode prod --tags tag1 --tags tag2",
10+
"commandToRun": "echo building b --production",
1111
"name": "b",
1212
},
1313
]
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"$schema": "https://developer.microsoft.com/json-schemas/rush/v5/rush-project.schema.json",
3+
"operationSettings": [
4+
{
5+
"operationName": "build",
6+
"parameterNamesToIgnore": ["--verbose", "--config", "--mode", "--tags"]
7+
}
8+
]
9+
}

0 commit comments

Comments
 (0)