Skip to content

Commit

Permalink
chore(open-payments): fix tests after update to ky
Browse files Browse the repository at this point in the history
  • Loading branch information
mkurapov committed Apr 18, 2024
1 parent 6e74048 commit 19f2a2c
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 26 deletions.
30 changes: 14 additions & 16 deletions packages/open-payments/src/client/incoming-payment.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe('incoming-payment', (): void => {
},
openApiValidators.successfulValidator
)
expect(result).toStrictEqual(incomingPayment)
expect(result).toEqual(incomingPayment)
})

test('throws if incoming payment does not pass validation', async (): Promise<void> => {
Expand Down Expand Up @@ -133,7 +133,7 @@ describe('incoming-payment', (): void => {
},
openApiValidators.successfulValidator
)
expect(result).toStrictEqual(publicIncomingPayment)
expect(result).toEqual(publicIncomingPayment)
})

test('throws if incoming payment does not pass open api validation', async (): Promise<void> => {
Expand Down Expand Up @@ -176,13 +176,13 @@ describe('incoming-payment', (): void => {
const result = await createIncomingPayment(
deps,
{ url: serverAddress, accessToken },
openApiValidators.successfulValidator,
{
walletAddress,
incomingAmount,
expiresAt,
metadata
}
},
openApiValidators.successfulValidator
)

scope.done()
Expand Down Expand Up @@ -211,8 +211,8 @@ describe('incoming-payment', (): void => {
await createIncomingPayment(
deps,
{ url: serverAddress, accessToken },
openApiValidators.successfulValidator,
{ walletAddress }
{ walletAddress },
openApiValidators.successfulValidator
)
} catch (error) {
assert.ok(error instanceof OpenPaymentsClientError)
Expand All @@ -237,8 +237,8 @@ describe('incoming-payment', (): void => {
createIncomingPayment(
deps,
{ url: serverAddress, accessToken },
openApiValidators.failedValidator,
{ walletAddress }
{ walletAddress },
openApiValidators.failedValidator
)
).rejects.toThrowError()
scope.done()
Expand Down Expand Up @@ -266,7 +266,7 @@ describe('incoming-payment', (): void => {

scope.done()

expect(result).toStrictEqual(incomingPayment)
expect(result).toEqual(incomingPayment)
})

test('throws if the incoming payment does not pass validation', async (): Promise<void> => {
Expand Down Expand Up @@ -364,7 +364,7 @@ describe('incoming-payment', (): void => {
}
)

expect(result).toStrictEqual(incomingPaymentPaginationResult)
expect(result).toEqual(incomingPaymentPaginationResult)
scope.done()
}
)
Expand Down Expand Up @@ -407,7 +407,7 @@ describe('incoming-payment', (): void => {
}
)

expect(result).toStrictEqual(incomingPaymentPaginationResult)
expect(result).toEqual(incomingPaymentPaginationResult)
scope.done()
}
)
Expand Down Expand Up @@ -498,9 +498,7 @@ describe('incoming-payment', (): void => {
completed: true
})

expect(validateIncomingPayment(incomingPayment)).toStrictEqual(
incomingPayment
)
expect(validateIncomingPayment(incomingPayment)).toEqual(incomingPayment)
})

test('throws if receiving and incoming amount asset scales are different', async (): Promise<void> => {
Expand Down Expand Up @@ -557,7 +555,7 @@ describe('incoming-payment', (): void => {
}
})

expect(validateCreatedIncomingPayment(incomingPayment)).toStrictEqual(
expect(validateCreatedIncomingPayment(incomingPayment)).toEqual(
incomingPayment
)
})
Expand Down Expand Up @@ -593,7 +591,7 @@ describe('incoming-payment', (): void => {
completed: true
})

expect(validateCompletedIncomingPayment(incomingPayment)).toStrictEqual(
expect(validateCompletedIncomingPayment(incomingPayment)).toEqual(
incomingPayment
)
})
Expand Down
10 changes: 4 additions & 6 deletions packages/open-payments/src/client/outgoing-payment.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe('outgoing-payment', (): void => {
},
openApiValidators.successfulValidator
)
expect(result).toStrictEqual(outgoingPayment)
expect(result).toEqual(outgoingPayment)
scope.done()
})

Expand Down Expand Up @@ -159,7 +159,7 @@ describe('outgoing-payment', (): void => {
cursor
}
)
expect(result).toStrictEqual(outgoingPaymentPaginationResult)
expect(result).toEqual(outgoingPaymentPaginationResult)
scope.done()
}
)
Expand Down Expand Up @@ -201,7 +201,7 @@ describe('outgoing-payment', (): void => {
cursor
}
)
expect(result).toStrictEqual(outgoingPaymentPaginationResult)
expect(result).toEqual(outgoingPaymentPaginationResult)
scope.done()
}
)
Expand Down Expand Up @@ -387,9 +387,7 @@ describe('outgoing-payment', (): void => {
test('returns outgoing payment if passes validation', async (): Promise<void> => {
const outgoingPayment = mockOutgoingPayment()

expect(validateOutgoingPayment(outgoingPayment)).toStrictEqual(
outgoingPayment
)
expect(validateOutgoingPayment(outgoingPayment)).toEqual(outgoingPayment)
})

test('throws if send amount and sent amount asset scales are different', async (): Promise<void> => {
Expand Down
4 changes: 2 additions & 2 deletions packages/open-payments/src/client/quote.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe('quote', (): void => {
},
openApiValidators.successfulValidator
)
expect(result).toStrictEqual(quote)
expect(result).toEqual(quote)
scope.done()
})

Expand Down Expand Up @@ -75,7 +75,7 @@ describe('quote', (): void => {
openApiValidators.successfulValidator,
{ receiver: quote.receiver, method: 'ilp', walletAddress }
)
expect(result).toStrictEqual(quote)
expect(result).toEqual(quote)
scope.done()
})

Expand Down
2 changes: 1 addition & 1 deletion packages/open-payments/src/client/token.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ describe('token', (): void => {
},
openApiValidators.successfulValidator
)
expect(result).toStrictEqual(accessToken)
expect(result).toEqual(accessToken)
scope.done()
})

Expand Down
2 changes: 1 addition & 1 deletion packages/open-payments/src/test/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const silentLogger = createLogger({
export const keyId = 'default-key-id'

export const defaultHttpClient = createHttpClient({
requestTimeoutMs: 0,
requestTimeoutMs: 1000,
keyId,
privateKey: generateKeyPairSync('ed25519').privateKey
})
Expand Down

0 comments on commit 19f2a2c

Please sign in to comment.