Skip to content

Commit 7703147

Browse files
author
DavertMik
committed
fixed refactoring
1 parent 52d91f4 commit 7703147

File tree

4 files changed

+14
-19
lines changed

4 files changed

+14
-19
lines changed

lib/step/base.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,3 @@ class Step {
179179
}
180180

181181
module.exports = Step
182-
183-
function dryRunResolver() {
184-
return {
185-
get(target, prop) {
186-
if (prop === 'toString') return () => '<VALUE>'
187-
return new Proxy({}, dryRunResolver())
188-
},
189-
}
190-
}

lib/step/meta.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
const Step = require('../step')
1+
const Step = require('./base')
22
const event = require('../event')
33
const { humanizeString } = require('../utils')
44

55
class MetaStep extends Step {
66
constructor(obj, method) {
77
if (!method) method = ''
8-
super(null, method)
8+
super(method)
99
this.actor = obj
1010
}
1111

lib/step/record.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const recorder = require('../recorder')
33
const StepConfig = require('./config')
44
const store = require('../store')
55
const { TIMEOUT_ORDER } = require('./timeout')
6-
6+
const retryStep = require('./retry')
77
function recordStep(step, args) {
88
step.status = 'queued'
99

@@ -67,10 +67,3 @@ function recordStep(step, args) {
6767
}
6868

6969
module.exports = recordStep
70-
71-
function retryStep(opts) {
72-
if (opts === undefined) opts = 1
73-
recorder.retry(opts)
74-
// remove retry once the step passed
75-
recorder.add(() => event.dispatcher.once(event.step.finished, () => recorder.retries.pop()))
76-
}

lib/step/retry.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const recorder = require('../recorder')
2+
const event = require('../event')
3+
4+
function retryStep(opts) {
5+
if (opts === undefined) opts = 1
6+
recorder.retry(opts)
7+
// remove retry once the step passed
8+
recorder.add(() => event.dispatcher.once(event.step.finished, () => recorder.retries.pop()))
9+
}
10+
11+
module.exports = retryStep

0 commit comments

Comments
 (0)