diff --git a/.eslintrc b/.eslintrc index 1bc3dee4..2988d5d8 100644 --- a/.eslintrc +++ b/.eslintrc @@ -12,20 +12,12 @@ "plugin:@typescript-eslint/recommended" ], "rules": { - "@typescript-eslint/no-this-alias": [ - "error", - { - "allowDestructuring": true, // Allow `const { props, state } = this`; false by default - "allowedNames": [ - "self" // Allow `const self= this`; `[]` by default - ] - } - ], + "@typescript-eslint/no-this-alias": "error", "@typescript-eslint/ban-types": "warn", "jest/no-disabled-tests": "warn", "jest/no-focused-tests": "error", - "jest/no-identical-title": "warn", - "jest/prefer-to-have-length": "warn", + "jest/no-identical-title": "error", + "jest/prefer-to-have-length": "error", "jest/valid-expect": "error" } } diff --git a/test/integ/repositories/dynamo-repository.test.ts b/test/integ/repositories/dynamo-repository.test.ts index 0e163706..bf1e1985 100644 --- a/test/integ/repositories/dynamo-repository.test.ts +++ b/test/integ/repositories/dynamo-repository.test.ts @@ -240,7 +240,7 @@ describe('OrdersRepository getOrders test', () => { expect(queryResult.orders[0]).toEqual(expect.objectContaining(MOCK_ORDER_3)) }) - it('should return no orders for chainId and orderStatus', async () => { + it('should return no orders for chainId, orderStatus, filler, when none match', async () => { const orders = await ordersRepository.getOrders(10, { chainId: 137, orderStatus: ORDER_STATUS.OPEN, filler: '0x3' }) expect(orders.orders).toEqual([]) }) diff --git a/test/integ/repositories/limit-orders-repository.test.ts b/test/integ/repositories/limit-orders-repository.test.ts index 797501f0..f869c6f8 100644 --- a/test/integ/repositories/limit-orders-repository.test.ts +++ b/test/integ/repositories/limit-orders-repository.test.ts @@ -230,7 +230,7 @@ describe('OrdersRepository getOrders test', () => { expect(queryResult.orders[0]).toEqual(expect.objectContaining(MOCK_ORDER_3)) }) - it('should return no orders for chainId and orderStatus', async () => { + it('should return no orders for chainId, orderStatus, filler, when none match', async () => { const orders = await ordersRepository.getOrders(10, { chainId: 137, orderStatus: ORDER_STATUS.OPEN, filler: '0x3' }) expect(orders.orders).toEqual([]) }) diff --git a/test/unit/services/check-order-status/util.test.ts b/test/unit/services/check-order-status/util.test.ts index f1032002..81d4ad0f 100644 --- a/test/unit/services/check-order-status/util.test.ts +++ b/test/unit/services/check-order-status/util.test.ts @@ -1,12 +1,12 @@ import { calculateDutchRetryWaitSeconds } from '../../../../lib/handlers/check-order-status/util' describe('calculateDutchRetryWaitSeconds', () => { - it('should do exponential backoff when retry count > 300', async () => { + it('should do exponential backoff when retry count > 300, retryCount:301', async () => { const response = calculateDutchRetryWaitSeconds(1, 301) expect(response).toEqual(13) }) - it('should do exponential backoff when retry count > 300', async () => { + it('should do exponential backoff when retry count > 300, retryCount:350', async () => { const response = calculateDutchRetryWaitSeconds(1, 350) expect(response).toEqual(138) }) diff --git a/test/unit/util/field-validator.test.ts b/test/unit/util/field-validator.test.ts index f5d7c778..6f255d93 100644 --- a/test/unit/util/field-validator.test.ts +++ b/test/unit/util/field-validator.test.ts @@ -175,20 +175,20 @@ describe('Testing each field on the FieldValidator class.', () => { }) }) - describe('Testing cursor field.', () => { + describe('Testing cursor field', () => { it('should validate field.', async () => { const cursor = 'eyJvcmRlckhhc2giOiIweGRlYWRiZWVmNTcxNDAzIn0=' expect(FieldValidator.isValidCursor().validate(cursor)).toEqual({ value: cursor }) }) - it('should invalidate field.', async () => { + it('should invalidate field with invalid cursor', async () => { const invalidCursor = '0xnot_a_valid_order_$$$$' const validatedField = FieldValidator.isValidCursor().validate(invalidCursor) expect(validatedField.error).toBeTruthy() expect(validatedField.error?.details[0].message).toEqual('"value" must be a valid base64 string') }) - it('should invalidate field.', async () => { + it('should invalidate field with maxLength cursor', async () => { const maxLengthCursor = `jfkasdjfkdsajfdjsafjdsjfkljsddkfjdhsajkgfhdgjkdfshgkfhdjkghjkfdhgjkh hsdfjhgjkfdshgjksdfjkgfdjkshgjkhsdfjkghfdjkghjkfdshgjklhdfsjkghkjfdshg hsdfjhgjkfdshgjksdfjkgfdjkshgjkhsdfjkghfdjkghjkfdshgjklhdfsjkghkjfdshg