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

fix(cli): Make unknown flag check a warning instead of an error #4028

Merged
merged 1 commit into from
Jan 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions lib/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,11 @@ export class Runner extends EventEmitter {
unknownFlags = unknownFlags.filter((f) => extraFlags.indexOf(f) === -1);
}
if (unknownFlags.length > 0 && !this.config_.disableChecks) {
throw new ConfigError(
logger,
'Found extra flags: ' + unknownFlags.join(', ') +
', please use --disableChecks flag to disable the Protractor CLI flag checks. ');
// TODO: Make this throw a ConfigError in Protractor 6.
logger.warn(
'Ignoring unknown extra flags: ' + unknownFlags.join(', ') + '. This will be' +
' an error in future versions, please use --disableChecks flag to disable the ' +
' Protractor CLI flag checks. ');
}
return this.plugins_.onPrepare().then(() => {
return helper.runFilenameOrFn_(this.config_.configDir, this.preparer_);
Expand Down
6 changes: 0 additions & 6 deletions scripts/errorTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@ var checkLogs = function(output, messages) {
*Below are exit failure tests*
******************************/

runProtractor = spawn('node',
['bin/protractor', 'example/conf.js', '--foobar', 'foobar']);
output = runProtractor.stdout.toString();
messages = ['Error: Found extra flags: foobar'];
checkLogs(output, messages);

// assert authentication error for sauce labs
runProtractor = spawn('node',
['bin/protractor', 'spec/errorTest/sauceLabsAuthentication.js']);
Expand Down