@@ -31,17 +31,21 @@ test('Snippet "Configuring SDK Anonymous" works', () => {
31
31
32
32
test('Snippet "Get customer info" works', async () => {
33
33
Purchases.configure(
34
- WEB_BILLING_PUBLIC_API_KEY,
35
- "customer_with_gold_entitlement"
34
+ {
35
+ apiKey: WEB_BILLING_PUBLIC_API_KEY,
36
+ appUserId: "customer_with_gold_entitlement",
37
+ }
36
38
);
37
39
expect(await getCustomerInfo()).toBeDefined();
38
40
Purchases.getSharedInstance().close();
39
41
});
40
42
41
43
test('Snippet "Check for specific entitlement" works for customer with entitlement', async () => {
42
44
Purchases.configure(
43
- WEB_BILLING_PUBLIC_API_KEY,
44
- "customer_with_gold_entitlement"
45
+ {
46
+ apiKey: WEB_BILLING_PUBLIC_API_KEY,
47
+ appUserId: "customer_with_gold_entitlement",
48
+ }
45
49
);
46
50
const callback = vi.fn();
47
51
await checkForSpecificEntitlement(callback);
@@ -51,8 +55,10 @@ test('Snippet "Check for specific entitlement" works for customer with entitleme
51
55
52
56
test('Snippet "Check for specific entitlement" works for customer without any entitlement', async () => {
53
57
Purchases.configure(
54
- WEB_BILLING_PUBLIC_API_KEY,
55
- "customer_without_entitlement"
58
+ {
59
+ apiKey: WEB_BILLING_PUBLIC_API_KEY,
60
+ appUserId: "customer_without_entitlement",
61
+ }
56
62
);
57
63
const callback = vi.fn();
58
64
await checkForSpecificEntitlement(callback);
@@ -62,8 +68,10 @@ test('Snippet "Check for specific entitlement" works for customer without any en
62
68
63
69
test('Snippet "Check for specific entitlement" works for customer with different entitlement', async () => {
64
70
Purchases.configure(
65
- WEB_BILLING_PUBLIC_API_KEY,
66
- "customer_with_silver_entitlement"
71
+ {
72
+ apiKey: WEB_BILLING_PUBLIC_API_KEY,
73
+ appUserId: "customer_with_silver_entitlement",
74
+ }
67
75
);
68
76
const callback = vi.fn();
69
77
await checkForSpecificEntitlement(callback);
@@ -74,14 +82,18 @@ test('Snippet "Check for specific entitlement" works for customer with different
74
82
test('Snippet "Check for any entitlement" works for both customers with entitlement', async () => {
75
83
const callback = vi.fn();
76
84
Purchases.configure(
77
- WEB_BILLING_PUBLIC_API_KEY,
78
- "customer_with_gold_entitlement"
85
+ {
86
+ apiKey: WEB_BILLING_PUBLIC_API_KEY,
87
+ appUserId: "customer_with_gold_entitlement",
88
+ }
79
89
);
80
90
await checkForAnyEntitlement(callback);
81
91
Purchases.getSharedInstance().close();
82
92
Purchases.configure(
83
- WEB_BILLING_PUBLIC_API_KEY,
84
- "customer_with_silver_entitlement"
93
+ {
94
+ apiKey: WEB_BILLING_PUBLIC_API_KEY,
95
+ appUserId: "customer_with_silver_entitlement",
96
+ }
85
97
);
86
98
await checkForAnyEntitlement(callback);
87
99
Purchases.getSharedInstance().close();
@@ -90,8 +102,10 @@ test('Snippet "Check for any entitlement" works for both customers with entitlem
90
102
91
103
test('Snippet "Check for any entitlement" works for customer without any entitlement', async () => {
92
104
Purchases.configure(
93
- WEB_BILLING_PUBLIC_API_KEY,
94
- "customer_without_entitlement"
105
+ {
106
+ apiKey: WEB_BILLING_PUBLIC_API_KEY,
107
+ appUserId: "customer_without_entitlement",
108
+ }
95
109
);
96
110
const callback = vi.fn();
97
111
await checkForAnyEntitlement(callback);
@@ -101,8 +115,10 @@ test('Snippet "Check for any entitlement" works for customer without any entitle
101
115
102
116
test('Snippet "Get current offering" works', async () => {
103
117
Purchases.configure(
104
- WEB_BILLING_PUBLIC_API_KEY,
105
- "customer_without_entitlement"
118
+ {
119
+ apiKey: WEB_BILLING_PUBLIC_API_KEY,
120
+ appUserId: "customer_without_entitlement",
121
+ }
106
122
);
107
123
let pkgs: Package[] | undefined;
108
124
const callback = vi
@@ -120,8 +136,10 @@ test('Snippet "Get current offering" works', async () => {
120
136
121
137
test('Snippet "Get current offering for EUR" works', async () => {
122
138
Purchases.configure(
123
- WEB_BILLING_PUBLIC_API_KEY,
124
- "customer_without_entitlement"
139
+ {
140
+ apiKey: WEB_BILLING_PUBLIC_API_KEY,
141
+ appUserId: "customer_without_entitlement",
142
+ }
125
143
);
126
144
let pkgs: Package[] | undefined;
127
145
const callback = vi
@@ -142,8 +160,10 @@ test('Snippet "Get current offering for EUR" works', async () => {
142
160
143
161
test('Snippet "Get custom offering" works', async () => {
144
162
Purchases.configure(
145
- WEB_BILLING_PUBLIC_API_KEY,
146
- "customer_without_entitlement"
163
+ {
164
+ apiKey: WEB_BILLING_PUBLIC_API_KEY,
165
+ appUserId: "customer_without_entitlement",
166
+ }
147
167
);
148
168
let pkgs: Package[] | null = null;
149
169
const callback = vi
@@ -165,8 +185,10 @@ test('Snippet "Get custom offering" works', async () => {
165
185
166
186
test('Snippet "Displaying packages" works', async () => {
167
187
Purchases.configure(
168
- WEB_BILLING_PUBLIC_API_KEY,
169
- "customer_without_entitlement"
188
+ {
189
+ apiKey: WEB_BILLING_PUBLIC_API_KEY,
190
+ appUserId: "customer_without_entitlement",
191
+ }
170
192
);
171
193
let allPackages: Package[] = [];
172
194
let monthlyPackage: Package | undefined;
@@ -198,8 +220,10 @@ test('Snippet "Displaying packages" works', async () => {
198
220
199
221
test('Snippet "Getting product" works', async () => {
200
222
Purchases.configure(
201
- WEB_BILLING_PUBLIC_API_KEY,
202
- "customer_without_entitlement"
223
+ {
224
+ apiKey: WEB_BILLING_PUBLIC_API_KEY,
225
+ appUserId: "customer_without_entitlement",
226
+ }
203
227
);
204
228
let product: Product | undefined;
205
229
const callback = vi.fn().mockImplementation((theProduct: Product) => {
@@ -215,8 +239,10 @@ test('Snippet "Getting product" works', async () => {
215
239
216
240
test('Snippet "Purchasing package" works', async () => {
217
241
Purchases.configure(
218
- WEB_BILLING_PUBLIC_API_KEY,
219
- "customer_without_entitlement"
242
+ {
243
+ apiKey: WEB_BILLING_PUBLIC_API_KEY,
244
+ appUserId: "customer_without_entitlement",
245
+ }
220
246
);
221
247
222
248
await purchasingPackage();
0 commit comments