Skip to content

Commit

Permalink
added env specific timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
timbrinded committed Oct 30, 2023
1 parent 8bbcefd commit 09eb528
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions .changeset/gorgeous-months-jog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
---

Fix process exit val
- Added new timeout config option for environments
4 changes: 2 additions & 2 deletions packages/cli/src/cmds/runTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ export async function executeTests(env: Environment, additionalArgs?: object) {
globals: true,
reporters: env.reporters ? env.reporters : ["default"],
outputFile: env.reportFile,
testTimeout: globalConfig.defaultTestTimeout,
hookTimeout: globalConfig.defaultTestTimeout,
testTimeout: env.timeout || globalConfig.defaultTestTimeout,
hookTimeout: env.timeout || globalConfig.defaultTestTimeout,
passWithNoTests: false,
deps: {
optimizer: { ssr: { enabled: false }, web: { enabled: false } },
Expand Down
4 changes: 4 additions & 0 deletions packages/types/config_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,10 @@
"type": "string"
},
"type": "array"
},
"timeout": {
"description": "The default timeout for tests and hooks",
"type": "number"
}
},
"type": "object"
Expand Down
5 changes: 5 additions & 0 deletions packages/types/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ export type Environment = {
*/
description?: string;

/**
* The default timeout for tests and hooks
*/
timeout?: number;

/**
* An array of directories with test files.
*/
Expand Down
1 change: 1 addition & 0 deletions test/moonwall.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@
{
"name": "zombie_test",
"testFileDir": ["suites/zombie"],
"timeout": 300000,
"reporters": ["basic"],
"foundation": {
"type": "zombie",
Expand Down

0 comments on commit 09eb528

Please sign in to comment.