Skip to content

Commit

Permalink
fix: set default retries to 0
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Jun 27, 2023
1 parent 2a197d1 commit 3468e98
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion src/config_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import type { CLIArgs, Config, Filters } from './types.js'
const DEFAULTS = {
files: [],
timeout: 2000,
retries: 1,
retries: 0,
forceExit: false,
plugins: [],
reporters: {
Expand Down
4 changes: 2 additions & 2 deletions src/create_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ export function createTest(
testInstance.options.meta.group = options.group
testInstance.options.meta.fileName = options.file

if (options.timeout) {
if (options.timeout !== undefined) {
testInstance.timeout(options.timeout)
}
if (options.retries) {
if (options.retries !== undefined) {
testInstance.retry(options.retries)
}

Expand Down
28 changes: 14 additions & 14 deletions tests/config_manager.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const USER_DEFINED_CONFIG_DATASET: [Config, Config][] = [
setup: [],
teardown: [],
plugins: [],
retries: 1,
retries: 0,
timeout: 2000,
},
],
Expand All @@ -59,7 +59,7 @@ const USER_DEFINED_CONFIG_DATASET: [Config, Config][] = [
plugins: [],
setup: [],
teardown: [],
retries: 1,
retries: 0,
timeout: 2000,
},
],
Expand All @@ -81,7 +81,7 @@ const USER_DEFINED_CONFIG_DATASET: [Config, Config][] = [
plugins: [],
setup: [],
teardown: [],
retries: 1,
retries: 0,
timeout: 4000,
},
],
Expand Down Expand Up @@ -213,7 +213,7 @@ const USER_DEFINED_CONFIG_DATASET: [Config, Config][] = [
plugins: [],
setup: [],
teardown: [],
retries: 1,
retries: 0,
timeout: 2000,
},
],
Expand All @@ -238,7 +238,7 @@ const USER_DEFINED_CONFIG_DATASET_WITH_CLI_ARGS: [Config, CLIArgs, Config][] = [
plugins: [],
setup: [],
teardown: [],
retries: 1,
retries: 0,
timeout: 2000,
},
],
Expand All @@ -262,7 +262,7 @@ const USER_DEFINED_CONFIG_DATASET_WITH_CLI_ARGS: [Config, CLIArgs, Config][] = [
plugins: [],
setup: [],
teardown: [],
retries: 1,
retries: 0,
timeout: 2000,
},
],
Expand All @@ -285,7 +285,7 @@ const USER_DEFINED_CONFIG_DATASET_WITH_CLI_ARGS: [Config, CLIArgs, Config][] = [
plugins: [],
setup: [],
teardown: [],
retries: 1,
retries: 0,
timeout: 1000,
},
],
Expand All @@ -308,7 +308,7 @@ const USER_DEFINED_CONFIG_DATASET_WITH_CLI_ARGS: [Config, CLIArgs, Config][] = [
name: 'unit',
files: 'tests/unit/**.spec.ts',
timeout: 1000,
retries: 1,
retries: 0,
configure: undefined,
},
],
Expand All @@ -322,7 +322,7 @@ const USER_DEFINED_CONFIG_DATASET_WITH_CLI_ARGS: [Config, CLIArgs, Config][] = [
plugins: [],
setup: [],
teardown: [],
retries: 1,
retries: 0,
timeout: 1000,
},
],
Expand Down Expand Up @@ -359,7 +359,7 @@ const USER_DEFINED_CONFIG_DATASET_WITH_CLI_ARGS: [Config, CLIArgs, Config][] = [
retries: 2,
},
],
retries: 1,
retries: 0,
},
new CliParser().parse(['--retries=4']),
{
Expand Down Expand Up @@ -594,7 +594,7 @@ const USER_DEFINED_CONFIG_DATASET_WITH_CLI_ARGS: [Config, CLIArgs, Config][] = [
plugins: [],
setup: [],
teardown: [],
retries: 1,
retries: 0,
timeout: 2000,
},
],
Expand All @@ -620,7 +620,7 @@ const USER_DEFINED_CONFIG_DATASET_WITH_CLI_ARGS: [Config, CLIArgs, Config][] = [
plugins: [],
setup: [],
teardown: [],
retries: 1,
retries: 0,
timeout: 2000,
},
],
Expand All @@ -646,7 +646,7 @@ const USER_DEFINED_CONFIG_DATASET_WITH_CLI_ARGS: [Config, CLIArgs, Config][] = [
plugins: [],
setup: [],
teardown: [],
retries: 1,
retries: 0,
timeout: 2000,
},
],
Expand All @@ -672,7 +672,7 @@ const USER_DEFINED_CONFIG_DATASET_WITH_CLI_ARGS: [Config, CLIArgs, Config][] = [
plugins: [],
setup: [],
teardown: [],
retries: 1,
retries: 0,
timeout: 2000,
},
],
Expand Down
18 changes: 9 additions & 9 deletions tests/planner.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ test.describe('Planner | files', () => {
new URL('../tests/planner.spec.ts', import.meta.url),
new URL('../tests/runner.spec.ts', import.meta.url),
],
retries: 1,
retries: 0,
timeout: 2000,
},
])
Expand All @@ -52,7 +52,7 @@ test.describe('Planner | files', () => {
name: 'default',
files: ['tests/**/*.spec.ts'],
filesURLs: [new URL('../tests/cli_parser.spec.ts', import.meta.url)],
retries: 1,
retries: 0,
timeout: 2000,
},
])
Expand All @@ -77,7 +77,7 @@ test.describe('Planner | files', () => {
new URL('../tests/planner.spec.ts', import.meta.url),
new URL('../tests/runner.spec.ts', import.meta.url),
],
retries: 1,
retries: 0,
timeout: 1000,
},
])
Expand Down Expand Up @@ -107,7 +107,7 @@ test.describe('Planner | files', () => {
new URL('../tests/planner.spec.ts', import.meta.url),
new URL('../tests/runner.spec.ts', import.meta.url),
],
retries: 1,
retries: 0,
timeout: 3000,
},
])
Expand Down Expand Up @@ -210,7 +210,7 @@ test.describe('Planner | suites', () => {
new URL('../tests/planner.spec.ts', import.meta.url),
new URL('../tests/runner.spec.ts', import.meta.url),
],
retries: 1,
retries: 0,
timeout: 2000,
configure: undefined,
},
Expand All @@ -234,7 +234,7 @@ test.describe('Planner | suites', () => {
new URL('../tests/config_manager.spec.ts', import.meta.url),
new URL('../tests/files_manager.spec.ts', import.meta.url),
],
retries: 1,
retries: 0,
timeout: 2000,
configure: undefined,
},
Expand Down Expand Up @@ -265,7 +265,7 @@ test.describe('Planner | suites', () => {
new URL('../tests/planner.spec.ts', import.meta.url),
new URL('../tests/runner.spec.ts', import.meta.url),
],
retries: 1,
retries: 0,
timeout: 1000,
configure: undefined,
},
Expand Down Expand Up @@ -296,7 +296,7 @@ test.describe('Planner | suites', () => {
new URL('../tests/planner.spec.ts', import.meta.url),
new URL('../tests/runner.spec.ts', import.meta.url),
],
retries: 1,
retries: 0,
timeout: 3000,
configure: undefined,
},
Expand Down Expand Up @@ -442,7 +442,7 @@ test.describe('Planner | suites', () => {
new URL('../tests/planner.spec.ts', import.meta.url),
new URL('../tests/runner.spec.ts', import.meta.url),
],
retries: 1,
retries: 0,
timeout: 2000,
configure: undefined,
},
Expand Down

0 comments on commit 3468e98

Please sign in to comment.