Skip to content

Commit d47d22c

Browse files
committed
need to invistigate
1 parent d01f19b commit d47d22c

2 files changed

Lines changed: 28 additions & 1 deletion

File tree

lib/commandExecutorBuilder.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ function buildCommandExecutor(failedByAssert, runOpts) {
1414

1515

1616
const executeCommandAsync = (cmd, index) => new Promise((resolve) => {
17-
17+
console.log(addSpecificOptionsBeforeRun)
1818
let watcher = null
19+
let additionalOpts = null
20+
let originalCmd = cmd
1921
let specificCallBack = null
2022
let killTooLongExecution = null
2123
let executionStack = ''
@@ -32,6 +34,7 @@ function buildCommandExecutor(failedByAssert, runOpts) {
3234
const cmdObj = addSpecificOptionsBeforeRun(cmd)
3335
cmd = cmdObj.cmd
3436
specificCallBack = cmdObj.cmdExecutableCB
37+
additionalOpts = cmd.replace(originalCmd, '')
3538
}
3639

3740
if(currentExecutionVariable) {
@@ -94,6 +97,10 @@ function buildCommandExecutor(failedByAssert, runOpts) {
9497
if(addCommandOptionsAfterRun && commandToRerun) {
9598
commandToRerun = addCommandOptionsAfterRun(commandToRerun, executionStack)
9699
}
100+
if(additionalOpts) {
101+
102+
}
103+
97104
resolve(commandToRerun)
98105
})
99106
})

unit_specs/index.spec.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,24 @@ describe('kernel', () => {
4646
expect(failedCmds.every((failedCmd) => failedCmd.includes(`CURRENT_EXECUTION_COUNT=${specRerunCount - 1}`))).to.eq(true)
4747
}
4848
})
49+
it.only('formCommanWithOption', async () => {
50+
let holder = null
51+
const cmd = `node -e "console.log('test'); process.exit(1)"`
52+
const stackAnalize = () => true
53+
const specRerunCount = 2
54+
const formCommanWithOption = (cmd) => {
55+
return {
56+
cmd: `TEST_ENV=test ${cmd}`,
57+
cmdExecutableCB: () => holder = true
58+
}
59+
}
60+
const cmds = [cmd]
61+
const reRunner = buildExeRun({
62+
stackAnalize,
63+
formCommanWithOption,
64+
specRerunCount
65+
})
66+
const failedCmds = await reRunner(cmds)
67+
expect(failedCmds).to.eql([`${cmd}`])
68+
})
4969
})

0 commit comments

Comments
 (0)