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/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(testName, async () => {
220
- // Enter test scope since bun calls from different scope
221
- scope.enter();
222
- try {
223
- await fn(scope);
224
- } catch (err) {
225
- console.error(err);
226
- throw err;
227
- } finally {
228
- if (options.destroy !== false) {
229
- await destroy(scope);
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
  }