Skip to content

Commit 52555af

Browse files
committed
22.0.0
1 parent ed911df commit 52555af

5 files changed

Lines changed: 191 additions & 5 deletions

File tree

CHANGES.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,98 @@
11
# Changes
22

3+
## 22.0.0
4+
5+
- [`ed911df5`](https://github.com/sinonjs/sinon/commit/ed911df50d2967d52f9ca341f1f15c8b4def8878)
6+
Update Ruby gems (Carl-Erik Kopseng)
7+
- [`75a1e5b8`](https://github.com/sinonjs/sinon/commit/75a1e5b80d9aab698fadd8bb8c30998f109e1841)
8+
Update to Node 26 (Carl-Erik Kopseng)
9+
- [`197d6608`](https://github.com/sinonjs/sinon/commit/197d660899fc8f9ac523e8ad9712f600c72cdbd2)
10+
Update documentation on faking timers to reflect the current state of fake-timers (Carl-Erik Kopseng)
11+
- [`c5ddf80b`](https://github.com/sinonjs/sinon/commit/c5ddf80bd8653ad9a3e539103a3c801e7bec112c)
12+
Update fake-timers@15.4: includes new Temporal API (Carl-Erik Kopseng)
13+
- [`f4ab02f6`](https://github.com/sinonjs/sinon/commit/f4ab02f6b78d4602401369d5797bbbb2a1110c7e)
14+
Update updatable packages (Carl-Erik Kopseng)
15+
- [`0536afc8`](https://github.com/sinonjs/sinon/commit/0536afc8fedd1db7dbc3557a2d162d1d8a1d12aa)
16+
Quality: Global mutable call id can grow unbounded across long-lived processes (#2691) (tuanaiseo)
17+
> - refactor: global mutable call id can grow unbounded across l
18+
>
19+
> `callId` is module-scoped and incremented on every invocation. In long-running test runners or embedded usage, this can grow indefinitely and eventually lose integer precision semantics for strict ordering comparisons.
20+
>
21+
> Affected files: proxy-invoke.js
22+
>
23+
> Signed-off-by: tuanaiseo <221258316+tuanaiseo@users.noreply.github.com>
24+
>
25+
> - Wrap around for all values that are too high
26+
>
27+
> ***
28+
>
29+
> Signed-off-by: tuanaiseo <221258316+tuanaiseo@users.noreply.github.com>
30+
> Co-authored-by: Carl-Erik Kopseng <carlerik@gmail.com>
31+
- [`f4f7d93b`](https://github.com/sinonjs/sinon/commit/f4f7d93bc6bd664400e74d153fd5812dae84d222)
32+
Perform additional cleanup when calling callThrough() (#2670) (Cyrille)
33+
- [`6199e9e4`](https://github.com/sinonjs/sinon/commit/6199e9e43db4440ea350961e2ef204236ca4ca4f)
34+
improve GitHubworkflows by introducing zizmor for monitoring (#2686) (Till!)
35+
> - fix(workflows): fetch-depth is for actions/checkout
36+
> - chore(workflows): update
37+
>
38+
> * pin all actions to precise commits
39+
> * avoid credential leakage from actions/checkout
40+
> * group action updates going forward
41+
> * add zimor config to ignore "secrets outside env"
42+
> * add job to keep validating workflows
43+
- [`f7476b59`](https://github.com/sinonjs/sinon/commit/f7476b59deda4893f9fa5b1e1dcfa74a059d4d4e)
44+
Use path.normalize() for path normalization (Carl-Erik Kopseng)
45+
- [`2c975393`](https://github.com/sinonjs/sinon/commit/2c975393f19b33c611cf7c4221f585cdffa3a619)
46+
fix: make build and node test scripts cross-platform (laplace young)
47+
- [`a7692917`](https://github.com/sinonjs/sinon/commit/a76929179340333cb7e9d55d8c00791683d674a5)
48+
fix: isolate walk state from Object prototype (laplace young)
49+
- [`66df977a`](https://github.com/sinonjs/sinon/commit/66df977a5cb7139de221512f80ca36504e8eb671)
50+
Fix sinon.restore() cascade-restoring sub-sandboxes (#2704) (Charlie Leitheiser)
51+
> The ESM port of `createApi` (#2683, shipped in 21.1.0) replaced `createSandbox: createSandbox` with a wrapper that pushes every newly-created sandbox into the root sandbox's fake collection:
52+
>
53+
> createSandbox: function createSandbox(config) {
54+
> const s = createConfiguredSandbox(config);
55+
> sandbox.getFakes().push(s);
56+
> return s;
57+
> }
58+
>
59+
> `Sandbox#restore` then walks that collection and calls `.restore()` on each entry. Because a sub-sandbox is itself an entry, every top-level `sinon.restore()` cascades into every sub-sandbox and undoes its stubs/timers/etc. — defeating the whole point of having an isolated sub-sandbox. The same cascade hits `resetHistory` and
60+
> `verifyAndRestore`. This is the regression reported in #2701.
61+
>
62+
> Restore the pre-21.1 behaviour: hand the root API a direct reference to `createConfiguredSandbox`. Sub-sandboxes are now isolated; only `subSandbox.restore()` (or `verifyAndRestore`) clears their fakes.
63+
>
64+
> Also flip the four sandbox tests that were locking in the buggy cascade: they now assert the parent's restore/resetHistory leaves the child untouched, with an explicit child-side cleanup at the
65+
> end.
66+
>
67+
> Closes #2701
68+
- [`f0bd6e1b`](https://github.com/sinonjs/sinon/commit/f0bd6e1b67155804f04e4b00623c4fb1d2549f97)
69+
fix: exclude **proto** from walk() (#2699) (Kevin Locke)
70+
> [`__proto__`] is a special property to access an object's prototype. It
71+
> has many pitfalls:
72+
>
73+
> - Setting it to an object value changes an object's prototype, which is
74+
> generally discouraged and may be unexpected by the `iterator` callback.
75+
> - Setting it to a non-object value does nothing (meaning `seen[k] =
76+
true` has no effect).
77+
> - When Node.js is run with the [`--disable-proto=throw`] option, getting
78+
> or setting `__proto__` causes an exception with code
79+
> `ERR_PROTO_ACCESS` to be thrown.
80+
>
81+
> Additionally, since this property (and all properties of
82+
> `Object.prototype`) are currently unused in this project by consumers of
83+
> `walk()`, it is both safe and preferable to exclude.
84+
>
85+
> [`__proto__`]: https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.prototype.__proto__
86+
> [`--disable-proto=throw`]: https://nodejs.org/api/cli.html#disable-protomode
87+
>
88+
> Fixes: #2695
89+
>
90+
> Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
91+
- [`1f8afd50`](https://github.com/sinonjs/sinon/commit/1f8afd50683aac84dbd501676399f39ae2b942bd)
92+
chore: add context7.json for ownership confirmation (Morgan Roderick)
93+
94+
_Released by [Carl-Erik Kopseng](https://github.com/fatso83) on 2026-05-05._
95+
396
## 21.1.2
497

598
- [`53817f7d`](https://github.com/sinonjs/sinon/commit/53817f7d3ab9447001ae7e622361c2f148170965)

docs/_config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ description: >-
55
url: https://sinonjs.org
66
github_username: sinonjs
77
sinon:
8-
current_release: v21.1.2
9-
current_major_version: 21
8+
current_release: v22.0.0
9+
current_major_version: 22
1010
markdown: kramdown
1111
kramdown:
1212
input: GFM

docs/changelog.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,99 @@ permalink: /releases/changelog
66

77
# Changelog
88

9+
## 22.0.0
10+
11+
- [`ed911df5`](https://github.com/sinonjs/sinon/commit/ed911df50d2967d52f9ca341f1f15c8b4def8878)
12+
Update Ruby gems (Carl-Erik Kopseng)
13+
- [`75a1e5b8`](https://github.com/sinonjs/sinon/commit/75a1e5b80d9aab698fadd8bb8c30998f109e1841)
14+
Update to Node 26 (Carl-Erik Kopseng)
15+
- [`197d6608`](https://github.com/sinonjs/sinon/commit/197d660899fc8f9ac523e8ad9712f600c72cdbd2)
16+
Update documentation on faking timers to reflect the current state of fake-timers (Carl-Erik Kopseng)
17+
- [`c5ddf80b`](https://github.com/sinonjs/sinon/commit/c5ddf80bd8653ad9a3e539103a3c801e7bec112c)
18+
Update fake-timers@15.4: includes new Temporal API (Carl-Erik Kopseng)
19+
- [`f4ab02f6`](https://github.com/sinonjs/sinon/commit/f4ab02f6b78d4602401369d5797bbbb2a1110c7e)
20+
Update updatable packages (Carl-Erik Kopseng)
21+
- [`0536afc8`](https://github.com/sinonjs/sinon/commit/0536afc8fedd1db7dbc3557a2d162d1d8a1d12aa)
22+
Quality: Global mutable call id can grow unbounded across long-lived processes (#2691) (tuanaiseo)
23+
> - refactor: global mutable call id can grow unbounded across l
24+
>
25+
> `callId` is module-scoped and incremented on every invocation. In long-running test runners or embedded usage, this can grow indefinitely and eventually lose integer precision semantics for strict ordering comparisons.
26+
>
27+
> Affected files: proxy-invoke.js
28+
>
29+
> Signed-off-by: tuanaiseo <221258316+tuanaiseo@users.noreply.github.com>
30+
>
31+
> - Wrap around for all values that are too high
32+
>
33+
> ***
34+
>
35+
> Signed-off-by: tuanaiseo <221258316+tuanaiseo@users.noreply.github.com>
36+
> Co-authored-by: Carl-Erik Kopseng <carlerik@gmail.com>
37+
- [`f4f7d93b`](https://github.com/sinonjs/sinon/commit/f4f7d93bc6bd664400e74d153fd5812dae84d222)
38+
Perform additional cleanup when calling callThrough() (#2670) (Cyrille)
39+
- [`6199e9e4`](https://github.com/sinonjs/sinon/commit/6199e9e43db4440ea350961e2ef204236ca4ca4f)
40+
improve GitHubworkflows by introducing zizmor for monitoring (#2686) (Till!)
41+
> - fix(workflows): fetch-depth is for actions/checkout
42+
> - chore(workflows): update
43+
>
44+
> * pin all actions to precise commits
45+
> * avoid credential leakage from actions/checkout
46+
> * group action updates going forward
47+
> * add zimor config to ignore "secrets outside env"
48+
> * add job to keep validating workflows
49+
- [`f7476b59`](https://github.com/sinonjs/sinon/commit/f7476b59deda4893f9fa5b1e1dcfa74a059d4d4e)
50+
Use path.normalize() for path normalization (Carl-Erik Kopseng)
51+
- [`2c975393`](https://github.com/sinonjs/sinon/commit/2c975393f19b33c611cf7c4221f585cdffa3a619)
52+
fix: make build and node test scripts cross-platform (laplace young)
53+
- [`a7692917`](https://github.com/sinonjs/sinon/commit/a76929179340333cb7e9d55d8c00791683d674a5)
54+
fix: isolate walk state from Object prototype (laplace young)
55+
- [`66df977a`](https://github.com/sinonjs/sinon/commit/66df977a5cb7139de221512f80ca36504e8eb671)
56+
Fix sinon.restore() cascade-restoring sub-sandboxes (#2704) (Charlie Leitheiser)
57+
> The ESM port of `createApi` (#2683, shipped in 21.1.0) replaced `createSandbox: createSandbox` with a wrapper that pushes every newly-created sandbox into the root sandbox's fake collection:
58+
>
59+
> createSandbox: function createSandbox(config) {
60+
> const s = createConfiguredSandbox(config);
61+
> sandbox.getFakes().push(s);
62+
> return s;
63+
> }
64+
>
65+
> `Sandbox#restore` then walks that collection and calls `.restore()` on each entry. Because a sub-sandbox is itself an entry, every top-level `sinon.restore()` cascades into every sub-sandbox and undoes its stubs/timers/etc. — defeating the whole point of having an isolated sub-sandbox. The same cascade hits `resetHistory` and
66+
> `verifyAndRestore`. This is the regression reported in #2701.
67+
>
68+
> Restore the pre-21.1 behaviour: hand the root API a direct reference to `createConfiguredSandbox`. Sub-sandboxes are now isolated; only `subSandbox.restore()` (or `verifyAndRestore`) clears their fakes.
69+
>
70+
> Also flip the four sandbox tests that were locking in the buggy cascade: they now assert the parent's restore/resetHistory leaves the child untouched, with an explicit child-side cleanup at the
71+
> end.
72+
>
73+
> Closes #2701
74+
- [`f0bd6e1b`](https://github.com/sinonjs/sinon/commit/f0bd6e1b67155804f04e4b00623c4fb1d2549f97)
75+
fix: exclude **proto** from walk() (#2699) (Kevin Locke)
76+
> [`__proto__`] is a special property to access an object's prototype. It
77+
> has many pitfalls:
78+
>
79+
> - Setting it to an object value changes an object's prototype, which is
80+
> generally discouraged and may be unexpected by the `iterator` callback.
81+
> - Setting it to a non-object value does nothing (meaning `seen[k] =
82+
true` has no effect).
83+
> - When Node.js is run with the [`--disable-proto=throw`] option, getting
84+
> or setting `__proto__` causes an exception with code
85+
> `ERR_PROTO_ACCESS` to be thrown.
86+
>
87+
> Additionally, since this property (and all properties of
88+
> `Object.prototype`) are currently unused in this project by consumers of
89+
> `walk()`, it is both safe and preferable to exclude.
90+
>
91+
> [`__proto__`]: https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.prototype.__proto__
92+
> [`--disable-proto=throw`]: https://nodejs.org/api/cli.html#disable-protomode
93+
>
94+
> Fixes: #2695
95+
>
96+
> Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
97+
- [`1f8afd50`](https://github.com/sinonjs/sinon/commit/1f8afd50683aac84dbd501676399f39ae2b942bd)
98+
chore: add context7.json for ownership confirmation (Morgan Roderick)
99+
100+
_Released by [Carl-Erik Kopseng](https://github.com/fatso83) on 2026-05-05._
101+
9102
## 21.1.2
10103

11104
- [`53817f7d`](https://github.com/sinonjs/sinon/commit/53817f7d3ab9447001ae7e622361c2f148170965)

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"xhr",
1616
"assert"
1717
],
18-
"version": "21.1.2",
18+
"version": "22.0.0",
1919
"homepage": "https://sinonjs.org/",
2020
"author": "Christian Johansen",
2121
"repository": {

0 commit comments

Comments
 (0)