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

Commit 721a38e

Browse files
committed
Add some documentation.
1 parent de89fc8 commit 721a38e

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

lib/config.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,8 @@ export interface Config {
596596
ng12Hybrid?: boolean;
597597

598598
/**
599-
* TODO
599+
* Protractor will exit with an error if it sees any command line flags it doesn't
600+
* recognize. Set disableChecks true to disable this check.
600601
*/
601602
disableChecks?: boolean;
602603

@@ -614,4 +615,3 @@ export interface Config {
614615
debug?: boolean;
615616
unknownFlags_?: string[];
616617
}
617-

lib/frameworks/README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ Requirements
3737

3838
- `runner.runTestPreparer` must be called after the framework has been
3939
initialized but before any spec files are run. This function returns a
40-
promise which should be waited on before executing tests.
40+
promise which should be waited on before executing tests. The framework should
41+
also pass an array of extra command line flags it accepts, if any.
4142

4243
- `runner.getConfig().onComplete` must be called when tests are finished.
4344
It might return a promise, in which case `exports.run`'s promise should not

lib/runner.ts

+6-5
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ import * as util from 'util';
66
import {ProtractorBrowser} from './browser';
77
import {Config} from './config';
88
import {buildDriverProvider, DriverProvider} from './driverProviders';
9+
import {ConfigError} from './exitCodes';
910
import {Logger} from './logger';
1011
import {Plugins} from './plugins';
1112
import {protractor} from './ptor';
1213
import * as helper from './util';
13-
import {ConfigError} from "./exitCodes";
1414

1515
declare let global: any;
1616
declare let process: any;
@@ -80,6 +80,7 @@ export class Runner extends EventEmitter {
8080
/**
8181
* Executor of testPreparer
8282
* @public
83+
* @param {string[]=} An optional list of command line arguments the framework will accept.
8384
* @return {q.Promise} A promise that will resolve when the test preparers
8485
* are finished.
8586
*/
@@ -88,11 +89,11 @@ export class Runner extends EventEmitter {
8889
if (extraFlags) {
8990
unknownFlags = unknownFlags.filter((f) => extraFlags.indexOf(f) != 0);
9091
}
91-
console.log(unknownFlags);
92-
if(unknownFlags.length > 0 && !this.config_.disableChecks) {
93-
throw new ConfigError(logger,
92+
if (unknownFlags.length > 0 && !this.config_.disableChecks) {
93+
throw new ConfigError(
94+
logger,
9495
'Found extra flags: ' + unknownFlags.join(', ') +
95-
', please use --disableChecks flag to disable the Protractor CLI flag checks. ');
96+
', please use --disableChecks flag to disable the Protractor CLI flag checks. ');
9697
}
9798
return this.plugins_.onPrepare().then(() => {
9899
return helper.runFilenameOrFn_(this.config_.configDir, this.preparer_);

0 commit comments

Comments
 (0)