Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

Commit 7481dee

Browse files
authored
fix(cli): Make unknown flag check a warning instead of an error. (#4028)
1 parent 588901c commit 7481dee

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

lib/runner.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,11 @@ export class Runner extends EventEmitter {
9393
unknownFlags = unknownFlags.filter((f) => extraFlags.indexOf(f) === -1);
9494
}
9595
if (unknownFlags.length > 0 && !this.config_.disableChecks) {
96-
throw new ConfigError(
97-
logger,
98-
'Found extra flags: ' + unknownFlags.join(', ') +
99-
', please use --disableChecks flag to disable the Protractor CLI flag checks. ');
96+
// TODO: Make this throw a ConfigError in Protractor 6.
97+
logger.warn(
98+
'Ignoring unknown extra flags: ' + unknownFlags.join(', ') + '. This will be' +
99+
' an error in future versions, please use --disableChecks flag to disable the ' +
100+
' Protractor CLI flag checks. ');
100101
}
101102
return this.plugins_.onPrepare().then(() => {
102103
return helper.runFilenameOrFn_(this.config_.configDir, this.preparer_);

scripts/errorTest.js

-6
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@ var checkLogs = function(output, messages) {
1919
*Below are exit failure tests*
2020
******************************/
2121

22-
runProtractor = spawn('node',
23-
['bin/protractor', 'example/conf.js', '--foobar', 'foobar']);
24-
output = runProtractor.stdout.toString();
25-
messages = ['Error: Found extra flags: foobar'];
26-
checkLogs(output, messages);
27-
2822
// assert authentication error for sauce labs
2923
runProtractor = spawn('node',
3024
['bin/protractor', 'spec/errorTest/sauceLabsAuthentication.js']);

0 commit comments

Comments
 (0)