You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
we noticed a regression in buffer comparison with the release of sinon 21.0.2
we have a test that started failing with the new release.
i've created a very simple standalone test that recreates it.
To Reproduce
the following test code snippet fails although it should succeed:
describe('test buffer', () => {
const func = (buffer) => {}
const key = 'key'
it.only('matches expected buffer', () => {
const spy = sinon.spy(func)
const buffer = Buffer.from(key, 'base64')
spy(buffer)
console.log('spy called with: ', spy.getCall(0).args[0])
console.log('buffer from key: ', Buffer.from(key, 'base64'))
assert.deepEqual(Buffer.from(key, 'base64'), spy.getCall(0).args[0])
sinon.assert.calledOnceWithExactly(spy, Buffer.from(key, 'base64'))
})
})
test buffer
matches expected buffer:
AssertError: expected func to be called once and with exact arguments
<Buffer 91 ec>
Expected behavior
succeed in comparing buffer arguments
Screenshots
N/A
Context (please complete the following information):
Activity
dhensby commentedon Mar 16, 2026
Also experienced this regression 21.0.1 works as expected, 21.0.2 breaks.
dhensby commentedon Mar 16, 2026
Looks like this could be the fix: sinonjs/samsam#291
fatso83 commentedon Mar 16, 2026
Duplicate of #2678. Fix is out