Skip to content

Commit

Permalink
fix(cli): increase --timeout default to 90 seconds (to match --help) (#…
Browse files Browse the repository at this point in the history
…683)

The timeout was decreased in 6f5498e
to 20 seconds (apparently accidentally since that commit was classfied
as a refactor ... and it also didn't update the --help text accordingly).

This commit changes it back to 90 seconds to match the --help text.
  • Loading branch information
not-my-profile committed Mar 16, 2023
1 parent 3a38cf7 commit d11481b
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/cli/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
rules: {
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/ban-ts-ignore': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/explicit-function-return-type': 'off'
},
overrides: [
Expand Down
4 changes: 3 additions & 1 deletion packages/cli/src/bin/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ program
)
.option(
'--timeout <n>',
'Set how much time (seconds) axe has to run (default: 90)'
'Set how much time (seconds) axe has to run',
// @ts-ignore
90
)
.option('--timer', 'Log the time it takes to run')
.option('--show-errors [boolean]', 'Display the full error stack', true)
Expand Down
1 change: 1 addition & 0 deletions packages/cli/src/lib/webdriver.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ describe('startDriver', () => {
beforeEach(() => {
browser = 'chrome-headless';
config = {
timeout: 90,
get browser() {
return browser;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/lib/webdriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { WebdriverConfigParams } from '../types';
const startDriver = async (
config: WebdriverConfigParams
): Promise<WebDriver> => {
const scriptTimeout = (config.timeout || 20) * 1000.0;
const scriptTimeout = config.timeout * 1000.0;
let builder: Builder;
/* istanbul ignore else */
if (config.browser === 'chrome-headless') {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export interface EventResponse {

export interface WebdriverConfigParams {
browser: string;
timeout?: number;
timeout: number;
chromedriverPath?: string;
path?: string;
chromeOptions?: string[];
Expand Down

0 comments on commit d11481b

Please sign in to comment.