Skip to content

Commit f24712a

Browse files
committed
fix: xo
1 parent eb768a9 commit f24712a

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

lib/worker.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ Worker.prototype.execute = function (input, cb, heartbeat) {
160160
setImmediate(() => {
161161
try {
162162
this.fn(input, cb, heartbeat);
163-
} catch (err) {
164-
cb(err);
163+
} catch (error) {
164+
cb(error);
165165
}
166166
});
167167
};

test/scenarios/sync-fn.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const test = require('ava').test;
1+
const {test} = require('ava');
22
const AWS = require('aws-sdk');
33
const StepFunctionWorker = require('../..');
44
const createActivity = require('../utils/create-activity');
@@ -39,8 +39,7 @@ const fnError = function () {
3939
test.before(before);
4040

4141
test.serial('Step function Activity Worker with 2 consecutive synchronous tasks', t => {
42-
const activityArn = context.activityArn;
43-
const stateMachineArn = context.stateMachineArn;
42+
const {activityArn, stateMachineArn} = context;
4443

4544
const worker = new StepFunctionWorker({
4645
activityArn,
@@ -87,8 +86,7 @@ test.serial('Step function Activity Worker with 2 consecutive synchronous tasks'
8786
});
8887

8988
test.serial('Step function Activity Worker with synchronous failing task', t => {
90-
const activityArn = context.activityArn;
91-
const stateMachineArn = context.stateMachineArn;
89+
const {activityArn, stateMachineArn} = context;
9290

9391
const worker = new StepFunctionWorker({
9492
activityArn,

test/scenarios/test.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,7 @@ test.serial('Restart the worker', t => {
183183
input: JSON.stringify({inputNumber: '1'})
184184
};
185185
return new Promise((resolve, reject) => {
186-
const countTask = 0;
187186
let countSuccess = 0;
188-
const workerNames = [];
189-
const startDate = new Date();
190187

191188
const onSuccess = function (out) {
192189
countSuccess++;

0 commit comments

Comments
 (0)