Fix lint errors

Signed-off-by: James Taylor <jamest@uk.ibm.com>
This commit is contained in:
James Taylor 2021-12-13 12:11:59 +00:00
parent 5d92abc52d
commit 66199000ca
3 changed files with 24 additions and 18 deletions

View file

@ -204,7 +204,10 @@ describe('Errors', () => {
});
it('returns RetryAction.None for a TransactionNotFoundError', () => {
const mockTransactionNotFoundError = new TransactionNotFoundError('Failed to get transaction with id txn, error Entry not found in index', 'txn1');
const mockTransactionNotFoundError = new TransactionNotFoundError(
'Failed to get transaction with id txn, error Entry not found in index',
'txn1'
);
expect(getRetryAction(mockTransactionNotFoundError)).toBe(
RetryAction.None
@ -212,19 +215,21 @@ describe('Errors', () => {
});
it('returns RetryAction.None for an AssetExistsError', () => {
const mockAssetExistsError = new AssetExistsError('The asset MOCK_ASSET already exists', 'txn1');
expect(getRetryAction(mockAssetExistsError)).toBe(
RetryAction.None
const mockAssetExistsError = new AssetExistsError(
'The asset MOCK_ASSET already exists',
'txn1'
);
expect(getRetryAction(mockAssetExistsError)).toBe(RetryAction.None);
});
it('returns RetryAction.None for an AssetNotFoundError', () => {
const mockAssetNotFoundError = new AssetNotFoundError('the asset MOCK_ASSET does not exist', 'txn1');
expect(getRetryAction(mockAssetNotFoundError)).toBe(
RetryAction.None
const mockAssetNotFoundError = new AssetNotFoundError(
'the asset MOCK_ASSET does not exist',
'txn1'
);
expect(getRetryAction(mockAssetNotFoundError)).toBe(RetryAction.None);
});
it('returns RetryAction.WithExistingTransactionId for a TimeoutError', () => {
@ -247,17 +252,13 @@ describe('Errors', () => {
it('returns RetryAction.WithNewTransactionId for an Error', () => {
const mockError = new Error('MOCK ERROR');
expect(getRetryAction(mockError)).toBe(
RetryAction.WithNewTransactionId
);
expect(getRetryAction(mockError)).toBe(RetryAction.WithNewTransactionId);
});
it('returns RetryAction.WithNewTransactionId for a string error', () => {
const mockError = 'MOCK ERROR';
expect(getRetryAction(mockError)).toBe(
RetryAction.WithNewTransactionId
);
expect(getRetryAction(mockError)).toBe(RetryAction.WithNewTransactionId);
});
});

View file

@ -12,10 +12,10 @@
* Fabric transaction error handling and retry logic
* - fabric.ts
* all the sample code which interacts with the Fabric SDK
*
*
* The remaining files are related to the REST server aspects of the sample,
* rather than Fabric itself:
*
*
* - *.router.ts
* details of the REST endpoints provided by the sample
* - auth.ts

View file

@ -3,7 +3,12 @@
*/
import { Job, Queue } from 'bullmq';
import { getJobCounts, getJobSummary, processSubmitTransactionJob, JobNotFoundError } from './jobs';
import {
getJobCounts,
getJobSummary,
processSubmitTransactionJob,
JobNotFoundError,
} from './jobs';
import { Contract, Transaction } from 'fabric-network';
import { mock, MockProxy } from 'jest-mock-extended';