Skip to content

Commit 88a9a1d

Browse files
committed
fix
1 parent 33c7c04 commit 88a9a1d

4 files changed

Lines changed: 16 additions & 18 deletions

File tree

.npmignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ node_modules
99
allure-results
1010
protractor.conf.js
1111
package-lock.json
12-
unit_specs
12+
unit_specs
13+
lol.js

lib/index.js

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ function reRunnerBuilder(runOptions) {
66
const failedByAssert = []
77
let currentSessionCount = 0
88

9+
let {attemptsCount} = runOptions
910
const {
1011
stackAnalize,
11-
attemptsCount,
1212
grepWord,
1313
debugProcess,
1414
reformatCommand,
@@ -50,23 +50,28 @@ function reRunnerBuilder(runOptions) {
5050
console.log(`Attempts count is: ${attemptsCount}`)
5151
}
5252

53+
if(typeof attemptsCount !== 'number') {
54+
console.warn('attemptsCount should be a number, 2 will be used as a default')
55+
attemptsCount = 2
56+
}
57+
5358
const failedCommands = await new Array(attemptsCount)
5459
// create array with current length
5560
.fill(attemptsCount)
5661
// execute run
5762
.reduce((resolver, /*current*/ current, index) => {
5863

5964
if(debugProcess) {
60-
console.log('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>')
61-
console.log(`Execution number: ${index}`)
62-
console.log('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>')
65+
console.info('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>')
66+
console.info(`Execution number: ${index}`)
67+
console.info('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>')
6368
}
6469

6570
return resolver.then((resolvedCommandsArray) => {
6671
if(debugProcess) {
67-
console.log('=========================================================================')
68-
console.log(`Processes count: ${resolvedCommandsArray.length}`)
69-
console.log('=========================================================================')
72+
console.info('=========================================================================')
73+
console.info(`Processes count: ${resolvedCommandsArray.length}`)
74+
console.info('=========================================================================')
7075
}
7176
return runCommandsArray(resolvedCommandsArray, [], index)
7277

lol.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1 @@
1-
const {spawn} = require('child_process')
2-
3-
const cmd = ['node', ['-e', "console.log(\'test\')"]]
4-
5-
const proc = spawn(...cmd)
6-
7-
proc.stdout.on('data', (data) => {
8-
console.log(data.toString('utf8'))
9-
})
1+
console.info('!!!!')

rerun.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ module.exports = {
99
getSpecCommands: function(pathToSpecDir, getRunCommandPattern) {
1010
return walkSync(pathToSpecDir).map(getRunCommandPattern)
1111
}
12-
}
12+
}

0 commit comments

Comments
 (0)