mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-22 09:35:10 +00:00
Fix lint errors
Signed-off-by: James Taylor <jamest@uk.ibm.com>
This commit is contained in:
parent
5d92abc52d
commit
66199000ca
3 changed files with 24 additions and 18 deletions
|
|
@ -204,7 +204,10 @@ describe('Errors', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns RetryAction.None for a TransactionNotFoundError', () => {
|
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(
|
expect(getRetryAction(mockTransactionNotFoundError)).toBe(
|
||||||
RetryAction.None
|
RetryAction.None
|
||||||
|
|
@ -212,19 +215,21 @@ describe('Errors', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns RetryAction.None for an AssetExistsError', () => {
|
it('returns RetryAction.None for an AssetExistsError', () => {
|
||||||
const mockAssetExistsError = new AssetExistsError('The asset MOCK_ASSET already exists', 'txn1');
|
const mockAssetExistsError = new AssetExistsError(
|
||||||
|
'The asset MOCK_ASSET already exists',
|
||||||
expect(getRetryAction(mockAssetExistsError)).toBe(
|
'txn1'
|
||||||
RetryAction.None
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
expect(getRetryAction(mockAssetExistsError)).toBe(RetryAction.None);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns RetryAction.None for an AssetNotFoundError', () => {
|
it('returns RetryAction.None for an AssetNotFoundError', () => {
|
||||||
const mockAssetNotFoundError = new AssetNotFoundError('the asset MOCK_ASSET does not exist', 'txn1');
|
const mockAssetNotFoundError = new AssetNotFoundError(
|
||||||
|
'the asset MOCK_ASSET does not exist',
|
||||||
expect(getRetryAction(mockAssetNotFoundError)).toBe(
|
'txn1'
|
||||||
RetryAction.None
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
expect(getRetryAction(mockAssetNotFoundError)).toBe(RetryAction.None);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns RetryAction.WithExistingTransactionId for a TimeoutError', () => {
|
it('returns RetryAction.WithExistingTransactionId for a TimeoutError', () => {
|
||||||
|
|
@ -247,17 +252,13 @@ describe('Errors', () => {
|
||||||
it('returns RetryAction.WithNewTransactionId for an Error', () => {
|
it('returns RetryAction.WithNewTransactionId for an Error', () => {
|
||||||
const mockError = new Error('MOCK ERROR');
|
const mockError = new Error('MOCK ERROR');
|
||||||
|
|
||||||
expect(getRetryAction(mockError)).toBe(
|
expect(getRetryAction(mockError)).toBe(RetryAction.WithNewTransactionId);
|
||||||
RetryAction.WithNewTransactionId
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns RetryAction.WithNewTransactionId for a string error', () => {
|
it('returns RetryAction.WithNewTransactionId for a string error', () => {
|
||||||
const mockError = 'MOCK ERROR';
|
const mockError = 'MOCK ERROR';
|
||||||
|
|
||||||
expect(getRetryAction(mockError)).toBe(
|
expect(getRetryAction(mockError)).toBe(RetryAction.WithNewTransactionId);
|
||||||
RetryAction.WithNewTransactionId
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,12 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Job, Queue } from 'bullmq';
|
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 { Contract, Transaction } from 'fabric-network';
|
||||||
import { mock, MockProxy } from 'jest-mock-extended';
|
import { mock, MockProxy } from 'jest-mock-extended';
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue