alchemy 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cloudflare/api-error.js +1 -1
- package/lib/cloudflare/bindings.d.ts +2 -1
- package/lib/cloudflare/bound.d.ts +2 -1
- package/lib/cloudflare/index.d.ts +2 -0
- package/lib/cloudflare/index.js +2 -0
- package/lib/cloudflare/vectorize-index.d.ts +136 -0
- package/lib/cloudflare/vectorize-index.js +170 -0
- package/lib/cloudflare/vectorize-metadata-index.d.ts +95 -0
- package/lib/cloudflare/vectorize-metadata-index.js +120 -0
- package/lib/cloudflare/worker.js +7 -0
- package/lib/cloudflare/wrangler.json.d.ts +7 -0
- package/lib/cloudflare/wrangler.json.js +10 -0
- package/lib/test/bun.js +4 -1
- package/package.json +1 -1
- package/src/cloudflare/api-error.ts +1 -1
- package/src/cloudflare/bindings.ts +2 -0
- package/src/cloudflare/bound.ts +8 -5
- package/src/cloudflare/index.ts +2 -0
- package/src/cloudflare/vectorize-index.ts +331 -0
- package/src/cloudflare/vectorize-metadata-index.ts +239 -0
- package/src/cloudflare/worker.ts +6 -0
- package/src/cloudflare/wrangler.json.ts +18 -0
- package/src/test/bun.ts +22 -14
package/src/test/bun.ts
CHANGED
|
@@ -189,6 +189,10 @@ export function test(meta: ImportMeta, defaultOptions?: TestOptions): test {
|
|
|
189
189
|
) {
|
|
190
190
|
const testName = args[0];
|
|
191
191
|
const _options = typeof args[1] === "object" ? args[1] : undefined;
|
|
192
|
+
const timeout =
|
|
193
|
+
typeof args[args.length - 1] === "number"
|
|
194
|
+
? (args[args.length - 1] as number)
|
|
195
|
+
: 120000;
|
|
192
196
|
const spread = (obj: any) =>
|
|
193
197
|
obj && typeof obj === "object"
|
|
194
198
|
? Object.fromEntries(
|
|
@@ -199,7 +203,7 @@ export function test(meta: ImportMeta, defaultOptions?: TestOptions): test {
|
|
|
199
203
|
: {};
|
|
200
204
|
|
|
201
205
|
// Merge options with defaults
|
|
202
|
-
const options = {
|
|
206
|
+
const options: TestOptions = {
|
|
203
207
|
destroy: true,
|
|
204
208
|
quiet: false,
|
|
205
209
|
password: "test-password",
|
|
@@ -216,20 +220,24 @@ export function test(meta: ImportMeta, defaultOptions?: TestOptions): test {
|
|
|
216
220
|
parent: localTestScope,
|
|
217
221
|
},
|
|
218
222
|
async (scope) => {
|
|
219
|
-
return it(
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
223
|
+
return it(
|
|
224
|
+
testName,
|
|
225
|
+
async () => {
|
|
226
|
+
// Enter test scope since bun calls from different scope
|
|
227
|
+
scope.enter();
|
|
228
|
+
try {
|
|
229
|
+
await fn(scope);
|
|
230
|
+
} catch (err) {
|
|
231
|
+
console.error(err);
|
|
232
|
+
throw err;
|
|
233
|
+
} finally {
|
|
234
|
+
if (options.destroy !== false) {
|
|
235
|
+
await destroy(scope);
|
|
236
|
+
}
|
|
230
237
|
}
|
|
231
|
-
}
|
|
232
|
-
|
|
238
|
+
},
|
|
239
|
+
timeout
|
|
240
|
+
);
|
|
233
241
|
}
|
|
234
242
|
);
|
|
235
243
|
}
|