Skip to content

Commit a6a45a2

Browse files
committed
fix cli test
Change-Id: I2b47d8436a7d864ee1483116bf282081b8144031
1 parent a2b167e commit a6a45a2

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

tests/cli.test.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ describe('cli args parsing', () => {
2121
categoryNetwork: true,
2222
'auto-connect': undefined,
2323
autoConnect: undefined,
24+
'performance-crux': true,
25+
performanceCrux: true,
2426
'usage-statistics': true,
2527
usageStatistics: true,
2628
};
@@ -272,4 +274,24 @@ describe('cli args parsing', () => {
272274
]);
273275
assert.strictEqual(disabledArgs.usageStatistics, false);
274276
});
277+
278+
it('parses performance crux flag', async () => {
279+
const defaultArgs = parseArguments('1.0.0', ['node', 'main.js']);
280+
assert.strictEqual(defaultArgs.performanceCrux, true);
281+
282+
// force enable
283+
const enabledArgs = parseArguments('1.0.0', [
284+
'node',
285+
'main.js',
286+
'--performance-crux',
287+
]);
288+
assert.strictEqual(enabledArgs.performanceCrux, true);
289+
290+
const disabledArgs = parseArguments('1.0.0', [
291+
'node',
292+
'main.js',
293+
'--no-performance-crux',
294+
]);
295+
assert.strictEqual(disabledArgs.performanceCrux, false);
296+
});
275297
});

0 commit comments

Comments
 (0)