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

Commit

Permalink
Add some documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
heathkit committed Jan 21, 2017
1 parent de89fc8 commit 721a38e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,8 @@ export interface Config {
ng12Hybrid?: boolean;

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

Expand All @@ -614,4 +615,3 @@ export interface Config {
debug?: boolean;
unknownFlags_?: string[];
}

3 changes: 2 additions & 1 deletion lib/frameworks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ Requirements

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

- `runner.getConfig().onComplete` must be called when tests are finished.
It might return a promise, in which case `exports.run`'s promise should not
Expand Down
11 changes: 6 additions & 5 deletions lib/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import * as util from 'util';
import {ProtractorBrowser} from './browser';
import {Config} from './config';
import {buildDriverProvider, DriverProvider} from './driverProviders';
import {ConfigError} from './exitCodes';
import {Logger} from './logger';
import {Plugins} from './plugins';
import {protractor} from './ptor';
import * as helper from './util';
import {ConfigError} from "./exitCodes";

declare let global: any;
declare let process: any;
Expand Down Expand Up @@ -80,6 +80,7 @@ export class Runner extends EventEmitter {
/**
* Executor of testPreparer
* @public
* @param {string[]=} An optional list of command line arguments the framework will accept.
* @return {q.Promise} A promise that will resolve when the test preparers
* are finished.
*/
Expand All @@ -88,11 +89,11 @@ export class Runner extends EventEmitter {
if (extraFlags) {
unknownFlags = unknownFlags.filter((f) => extraFlags.indexOf(f) != 0);
}
console.log(unknownFlags);
if(unknownFlags.length > 0 && !this.config_.disableChecks) {
throw new ConfigError(logger,
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. ');
', 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

0 comments on commit 721a38e

Please sign in to comment.