Skip to content

Commit 3062ea7

Browse files
chore: update package.json and improve test formatting
- Added an override in package.json for Jest environment configuration in jest.setup.js. - Refactored test code for better readability in usePaymentCheckout and withApplePay tests. - Enhanced formatting in paymentHelpers test for consistency.
1 parent 2a33468 commit 3062ea7

5 files changed

Lines changed: 16 additions & 7 deletions

File tree

‎package/package.json‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,16 @@
4343
"plugins": [
4444
"prettier"
4545
],
46+
"overrides": [
47+
{
48+
"files": [
49+
"jest.setup.js"
50+
],
51+
"env": {
52+
"jest": true
53+
}
54+
}
55+
],
4656
"rules": {
4757
"prettier/prettier": [
4858
"warn",

‎package/src/hooks/__tests__/usePaymentCheckout.integration.test.ts‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@ describe('usePaymentCheckout integration', () => {
2323
mockStartPayment.mockReset()
2424
})
2525

26-
const renderCheckout = () =>
27-
renderHook(() =>
28-
usePaymentCheckout({})
29-
)
26+
const renderCheckout = () => renderHook(() => usePaymentCheckout({}))
3027

3128
it('loads payment service status on mount', async () => {
3229
const { result } = renderCheckout()

‎package/src/plugin/__tests__/withApplePay.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ describe('withApplePay', () => {
7676
expect(result).toEqual({
7777
modResults: {
7878
'com.apple.developer.in-app-payments': ['merchant.com.test'],
79-
ReactNativePayApplePayMerchantIdentifiers: ['merchant.com.test'],
79+
'ReactNativePayApplePayMerchantIdentifiers': ['merchant.com.test'],
8080
},
8181
})
8282
})

‎package/src/utils/__tests__/paymentHelpers.test.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ describe('paymentHelpers', () => {
7171
expect(request.supportedNetworks).toEqual(['visa'])
7272
expect(request.merchantCapabilities).toEqual(['EMV'])
7373
expect(request.merchantName).toBe('My Store')
74-
expect(request.applePayMerchantIdentifier).toBe('merchant.com.apple.override')
74+
expect(request.applePayMerchantIdentifier).toBe(
75+
'merchant.com.apple.override'
76+
)
7577
expect(request.googlePayMerchantId).toBe('google-pay-merchant-id')
7678
})
7779

‎package/tsconfig.tsbuildinfo‎

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)