bun-types 1.3.4-canary.20251205T140731 → 1.3.4-canary.20251207T140548

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.
@@ -60,7 +60,7 @@ test("random", async () => {
60
60
 
61
61
  expect(random).toHaveBeenCalled();
62
62
  expect(random).toHaveBeenCalledTimes(3);
63
- expect(random.mock.args).toEqual([[1], [2], [3]]);
63
+ expect(random.mock.calls).toEqual([[1], [2], [3]]);
64
64
  expect(random.mock.results[0]).toEqual({ type: "return", value: a });
65
65
  });
66
66
  ```
@@ -428,26 +428,26 @@ test("foo, bar, baz", () => {
428
428
  const barSpy = spyOn(barModule, "bar");
429
429
  const bazSpy = spyOn(bazModule, "baz");
430
430
 
431
- // Original values
432
- expect(fooSpy).toBe("foo");
433
- expect(barSpy).toBe("bar");
434
- expect(bazSpy).toBe("baz");
431
+ // Original implementations still work
432
+ expect(fooModule.foo()).toBe("foo");
433
+ expect(barModule.bar()).toBe("bar");
434
+ expect(bazModule.baz()).toBe("baz");
435
435
 
436
436
  // Mock implementations
437
437
  fooSpy.mockImplementation(() => 42);
438
438
  barSpy.mockImplementation(() => 43);
439
439
  bazSpy.mockImplementation(() => 44);
440
440
 
441
- expect(fooSpy()).toBe(42);
442
- expect(barSpy()).toBe(43);
443
- expect(bazSpy()).toBe(44);
441
+ expect(fooModule.foo()).toBe(42);
442
+ expect(barModule.bar()).toBe(43);
443
+ expect(bazModule.baz()).toBe(44);
444
444
 
445
445
  // Restore all
446
446
  mock.restore();
447
447
 
448
- expect(fooSpy()).toBe("foo");
449
- expect(barSpy()).toBe("bar");
450
- expect(bazSpy()).toBe("baz");
448
+ expect(fooModule.foo()).toBe("foo");
449
+ expect(barModule.bar()).toBe("bar");
450
+ expect(bazModule.baz()).toBe("baz");
451
451
  });
452
452
  ```
453
453
 
@@ -455,10 +455,10 @@ Using `mock.restore()` can reduce the amount of code in your tests by adding it
455
455
 
456
456
  ## Vitest Compatibility
457
457
 
458
- For added compatibility with tests written for Vitest, Bun provides the `vi` global object as an alias for parts of the Jest mocking API:
458
+ For added compatibility with tests written for Vitest, Bun provides the `vi` object as an alias for parts of the Jest mocking API:
459
459
 
460
460
  ```ts title="test.ts" icon="/icons/typescript.svg"
461
- import { test, expect } from "bun:test";
461
+ import { test, expect, vi } from "bun:test";
462
462
 
463
463
  // Using the 'vi' alias similar to Vitest
464
464
  test("vitest compatibility", () => {
package/package.json CHANGED
@@ -33,5 +33,5 @@
33
33
  "bun.js",
34
34
  "types"
35
35
  ],
36
- "version": "1.3.4-canary.20251205T140731"
36
+ "version": "1.3.4-canary.20251207T140548"
37
37
  }
package/serve.d.ts CHANGED
@@ -446,7 +446,7 @@ declare module "bun" {
446
446
  closeOnBackpressureLimit?: boolean;
447
447
 
448
448
  /**
449
- * Sets the the number of seconds to wait before timing out a connection
449
+ * Sets the number of seconds to wait before timing out a connection
450
450
  * due to no messages or pings.
451
451
  *
452
452
  * @default 120
@@ -758,7 +758,7 @@ declare module "bun" {
758
758
  ipv6Only?: boolean;
759
759
 
760
760
  /**
761
- * Sets the the number of seconds to wait before timing out a connection
761
+ * Sets the number of seconds to wait before timing out a connection
762
762
  * due to inactivity.
763
763
  *
764
764
  * @default 10