Skip to content

Commit

Permalink
feat(pest): add option to add arbitrary pest arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
innocenzi committed Sep 17, 2024
1 parent 0db690c commit 0173a9c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@
"type": "boolean",
"default": true,
"description": "Stop execution upon first non-passing test."
},
"hybridly.test.arguments": {
"type": "string",
"default": "",
"description": "Add arbitrary arguments to all test commands."
}
}
},
Expand Down
5 changes: 5 additions & 0 deletions src/utils/tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export async function runTestsTask(cwd: string, args: string = '') {
const testDirectory = getSetting('test.directory')
const retries = getSetting('test.retry')
const bail = getSetting('test.bail')
const settingArgs = getSetting('test.arguments')

if (testDirectory && !args.includes('--test-directory')) {
args += ` --test-directory=${testDirectory} ${args}`
Expand All @@ -35,6 +36,10 @@ export async function runTestsTask(cwd: string, args: string = '') {
args += ' --bail'
}

if (settingArgs) {
args += ` ${settingArgs}`
}

const binaryName = process.platform === 'win32' ? 'pest.bat' : 'pest'
const binaryPath = path.join(cwd, 'vendor', 'bin', binaryName)
const command = `${binaryPath} ${args}`
Expand Down

0 comments on commit 0173a9c

Please sign in to comment.