Skip to content

Commit

Permalink
fix: unhandled issue with got pkg (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
pritamstyz4ever authored Sep 10, 2021
1 parent 5f47568 commit b81583f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,10 @@ class ExecutorQueue extends Executor {
* @return Promise.resolve
*/
async api(config, args) {
const body = Object.assign({}, config);
const { token } = body;
const json = { ...config };
const { token } = json;

delete body.token;
delete json.token;

const options = {
headers: {
Expand All @@ -228,7 +228,7 @@ class ExecutorQueue extends Executor {
afterResponse: [this.requestRetryStrategy]
},
method: args.method,
body
json
};

return requestretry(options).then(response => response.body);
Expand Down
16 changes: 8 additions & 8 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ describe('index test', () => {
...requestOptions,
url: 'http://localhost/v1/queue/message?type=periodic',
method: 'POST',
body: periodicConfig
json: periodicConfig
};

return executor.startPeriodic(periodicConfig, err => {
Expand All @@ -107,7 +107,7 @@ describe('index test', () => {
...requestOptions,
url: 'http://localhost/v1/queue/message?type=periodic',
method: 'DELETE',
body: testConfig
json: testConfig
};

return executor.stopPeriodic(testConfig, err => {
Expand All @@ -126,7 +126,7 @@ describe('index test', () => {
Object.assign(requestOptions, {
url: 'http://localhost/v1/queue/message',
method: 'POST',
body: startConfig
json: startConfig
});

return executor.start(startConfig, err => {
Expand All @@ -144,7 +144,7 @@ describe('index test', () => {
Object.assign(requestOptions, {
url: 'http://localhost/v1/queue/message?type=frozen',
method: 'POST',
body: testConfig
json: testConfig
});

return executor.startFrozen(testConfig, err => {
Expand All @@ -162,7 +162,7 @@ describe('index test', () => {
Object.assign(requestOptions, {
url: 'http://localhost/v1/queue/message?type=frozen',
method: 'DELETE',
body: testConfig
json: testConfig
});

return executor.stopFrozen(testConfig, err => {
Expand Down Expand Up @@ -190,7 +190,7 @@ describe('index test', () => {
Object.assign(requestOptions, {
url: 'http://localhost/v1/queue/message',
method: 'DELETE',
body: stopConfig
json: stopConfig
});

executor.stop(stopConfig, err => {
Expand Down Expand Up @@ -250,7 +250,7 @@ describe('index test', () => {
Object.assign(requestOptions, {
url: 'http://localhost/v1/queue/message?type=timer',
method: 'DELETE',
body: timerConfig
json: timerConfig
});

return executor.stopTimer(timerConfig, err => {
Expand Down Expand Up @@ -285,7 +285,7 @@ describe('index test', () => {
Object.assign(requestOptions, {
url: 'http://localhost/v1/queue/message?type=timer',
method: 'POST',
body: testConfig
json: testConfig
});

return executor.startTimer(timerConfig, err => {
Expand Down

0 comments on commit b81583f

Please sign in to comment.