Skip to content

Commit 6f3b9ea

Browse files
authored
feat: partial (API Keys, Audiences, and Contacts) non-mocked test coverage (#663)
1 parent 99bca1d commit 6f3b9ea

File tree

40 files changed

+9593
-6
lines changed

40 files changed

+9593
-6
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules
22
dist
33
build
4+
.env.test

package.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@
3131
"lint": "biome check .",
3232
"prepublishOnly": "pnpm run build",
3333
"test": "vitest run",
34-
"test:watch": "vitest"
34+
"test:watch": "vitest",
35+
"test:record": "rimraf --glob \"**/__recordings__\" && cross-env TEST_MODE=record vitest run",
36+
"test:dev": "cross-env TEST_MODE=dev vitest run"
3537
},
3638
"repository": {
3739
"type": "git",
@@ -53,9 +55,15 @@
5355
},
5456
"devDependencies": {
5557
"@biomejs/biome": "2.2.5",
58+
"@pollyjs/adapter-fetch": "6.0.7",
59+
"@pollyjs/core": "6.0.6",
60+
"@pollyjs/persister-fs": "6.0.6",
5661
"@types/node": "22.18.9",
5762
"@types/react": "19.2.0",
63+
"cross-env": "10.1.0",
64+
"dotenv": "17.2.3",
5865
"pkg-pr-new": "0.0.60",
66+
"rimraf": "6.0.1",
5967
"tsup": "8.5.0",
6068
"typescript": "5.9.3",
6169
"vitest": "3.2.4",

pnpm-lock.yaml

Lines changed: 942 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,229 @@
1+
{
2+
"log": {
3+
"_recordingName": "API Keys Integration Tests > create > allows creating an API key with an empty name",
4+
"creator": {
5+
"comment": "persister:fs",
6+
"name": "Polly.JS",
7+
"version": "6.0.6"
8+
},
9+
"entries": [
10+
{
11+
"_id": "08e45cbee1a68cd6c50beacab63ff057",
12+
"_order": 0,
13+
"cache": {},
14+
"request": {
15+
"bodySize": 11,
16+
"cookies": [],
17+
"headers": [
18+
{
19+
"name": "authorization",
20+
"value": "Bearer re_REDACTED_API_KEY"
21+
},
22+
{
23+
"name": "content-type",
24+
"value": "application/json"
25+
},
26+
{
27+
"name": "user-agent",
28+
"value": "resend-node:6.2.0-canary.2"
29+
}
30+
],
31+
"headersSize": 181,
32+
"httpVersion": "HTTP/1.1",
33+
"method": "POST",
34+
"postData": {
35+
"mimeType": "application/json",
36+
"params": [],
37+
"text": "{\"name\":\"\"}"
38+
},
39+
"queryString": [],
40+
"url": "https://api.resend.com/api-keys"
41+
},
42+
"response": {
43+
"bodySize": 108,
44+
"content": {
45+
"mimeType": "application/json; charset=utf-8",
46+
"size": 108,
47+
"text": "{\"id\":\"29b93cc6-1ca3-4733-8e64-cae19780862f\",\"object\":\"list\",\"token\":\"re_REDACTED_API_KEY\"}"
48+
},
49+
"cookies": [],
50+
"headers": [
51+
{
52+
"name": "cf-cache-status",
53+
"value": "DYNAMIC"
54+
},
55+
{
56+
"name": "cf-ray",
57+
"value": "98b285dffb08eb3d-SEA"
58+
},
59+
{
60+
"name": "connection",
61+
"value": "keep-alive"
62+
},
63+
{
64+
"name": "content-length",
65+
"value": "108"
66+
},
67+
{
68+
"name": "content-type",
69+
"value": "application/json; charset=utf-8"
70+
},
71+
{
72+
"name": "date",
73+
"value": "Wed, 08 Oct 2025 03:24:02 GMT"
74+
},
75+
{
76+
"name": "etag",
77+
"value": "W/\"6c-gRGSXeJ1NgQrkIf9bPKYMYWykiU\""
78+
},
79+
{
80+
"name": "ratelimit-limit",
81+
"value": "2"
82+
},
83+
{
84+
"name": "ratelimit-policy",
85+
"value": "2;w=1"
86+
},
87+
{
88+
"name": "ratelimit-remaining",
89+
"value": "1"
90+
},
91+
{
92+
"name": "ratelimit-reset",
93+
"value": "1"
94+
},
95+
{
96+
"name": "server",
97+
"value": "cloudflare"
98+
}
99+
],
100+
"headersSize": 338,
101+
"httpVersion": "HTTP/1.1",
102+
"redirectURL": "",
103+
"status": 201,
104+
"statusText": "Created"
105+
},
106+
"startedDateTime": "2025-10-08T03:24:01.871Z",
107+
"time": 125,
108+
"timings": {
109+
"blocked": -1,
110+
"connect": -1,
111+
"dns": -1,
112+
"receive": 0,
113+
"send": 0,
114+
"ssl": -1,
115+
"wait": 125
116+
}
117+
},
118+
{
119+
"_id": "71d647522c6be8a167d989fb62c324d8",
120+
"_order": 0,
121+
"cache": {},
122+
"request": {
123+
"bodySize": 0,
124+
"cookies": [],
125+
"headers": [
126+
{
127+
"name": "authorization",
128+
"value": "Bearer re_REDACTED_API_KEY"
129+
},
130+
{
131+
"name": "content-type",
132+
"value": "application/json"
133+
},
134+
{
135+
"name": "user-agent",
136+
"value": "resend-node:6.2.0-canary.2"
137+
}
138+
],
139+
"headersSize": 220,
140+
"httpVersion": "HTTP/1.1",
141+
"method": "DELETE",
142+
"queryString": [],
143+
"url": "https://api.resend.com/api-keys/29b93cc6-1ca3-4733-8e64-cae19780862f"
144+
},
145+
"response": {
146+
"bodySize": 76,
147+
"content": {
148+
"mimeType": "application/json; charset=utf-8",
149+
"size": 76,
150+
"text": "{\"object\":\"list\",\"id\":\"29b93cc6-1ca3-4733-8e64-cae19780862f\",\"deleted\":true}"
151+
},
152+
"cookies": [],
153+
"headers": [
154+
{
155+
"name": "cf-cache-status",
156+
"value": "DYNAMIC"
157+
},
158+
{
159+
"name": "cf-ray",
160+
"value": "98b285e48ed0eb3d-SEA"
161+
},
162+
{
163+
"name": "connection",
164+
"value": "keep-alive"
165+
},
166+
{
167+
"name": "content-encoding",
168+
"value": "br"
169+
},
170+
{
171+
"name": "content-type",
172+
"value": "application/json; charset=utf-8"
173+
},
174+
{
175+
"name": "date",
176+
"value": "Wed, 08 Oct 2025 03:24:02 GMT"
177+
},
178+
{
179+
"name": "etag",
180+
"value": "W/\"4c-yk4rxjm2/9a3ewUWaHq1l1ySMQE\""
181+
},
182+
{
183+
"name": "ratelimit-limit",
184+
"value": "2"
185+
},
186+
{
187+
"name": "ratelimit-policy",
188+
"value": "2;w=1"
189+
},
190+
{
191+
"name": "ratelimit-remaining",
192+
"value": "0"
193+
},
194+
{
195+
"name": "ratelimit-reset",
196+
"value": "1"
197+
},
198+
{
199+
"name": "server",
200+
"value": "cloudflare"
201+
},
202+
{
203+
"name": "transfer-encoding",
204+
"value": "chunked"
205+
}
206+
],
207+
"headersSize": 367,
208+
"httpVersion": "HTTP/1.1",
209+
"redirectURL": "",
210+
"status": 200,
211+
"statusText": "OK"
212+
},
213+
"startedDateTime": "2025-10-08T03:24:02.599Z",
214+
"time": 138,
215+
"timings": {
216+
"blocked": -1,
217+
"connect": -1,
218+
"dns": -1,
219+
"receive": 0,
220+
"send": 0,
221+
"ssl": -1,
222+
"wait": 138
223+
}
224+
}
225+
],
226+
"pages": [],
227+
"version": "1.2"
228+
}
229+
}

0 commit comments

Comments
 (0)