Skip to content

Commit

Permalink
test: Refactor to async/await
Browse files Browse the repository at this point in the history
  • Loading branch information
medikoo committed Jun 2, 2021
1 parent 787267a commit fd5e40d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/unit/lib/aws/request.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ describe('#request', () => {
return expect(sendFake.promise).to.have.been.calledOnce;
});

it('should expose non-retryable errors', () => {
it('should expose non-retryable errors', async () => {
const error = {
statusCode: 500,
message: 'Some error message',
Expand All @@ -247,13 +247,13 @@ describe('#request', () => {
const awsRequest = proxyquire('../../../../lib/aws/request', {
'aws-sdk': { S3: FakeS3 },
});
return expect(awsRequest({ name: 'S3' }, 'test')).to.eventually.be.rejected.and.have.property(
await expect(awsRequest({ name: 'S3' }, 'test')).to.eventually.be.rejected.and.have.property(
'code',
'AWS_S3_TEST_SOME_ERROR'
);
});

it('should handle numeric error codes', () => {
it('should handle numeric error codes', async () => {
const error = {
statusCode: 500,
message: 'Some error message',
Expand All @@ -271,7 +271,7 @@ describe('#request', () => {
const awsRequest = proxyquire('../../../../lib/aws/request', {
'aws-sdk': { S3: FakeS3 },
});
return expect(awsRequest({ name: 'S3' }, 'test')).to.eventually.be.rejected.and.have.property(
await expect(awsRequest({ name: 'S3' }, 'test')).to.eventually.be.rejected.and.have.property(
'code',
'AWS_S3_TEST_HTTP_500_ERROR'
);
Expand Down

0 comments on commit fd5e40d

Please sign in to comment.