From 9b2f11b86001747e93106e201f66c79261d8f4b0 Mon Sep 17 00:00:00 2001 From: Maxim Shishmarev Date: Tue, 14 Jul 2020 10:04:04 +1000 Subject: [PATCH] Use stub instead of replace --- ts/test/session/crypto/MessageEncrypter_test.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ts/test/session/crypto/MessageEncrypter_test.ts b/ts/test/session/crypto/MessageEncrypter_test.ts index 7be40cad2..2e1753512 100644 --- a/ts/test/session/crypto/MessageEncrypter_test.ts +++ b/ts/test/session/crypto/MessageEncrypter_test.ts @@ -52,11 +52,10 @@ describe('MessageEncrypter', () => { it('should return a MEDIUM_GROUP_CIPHERTEXT envelope type', async () => { const data = crypto.randomBytes(10); - sandbox.replace( + sandbox.stub( Ratchet, - 'encryptWithSenderKey', - sinon.fake.returns({ ciphertext: '' }) - ); + 'encryptWithSenderKey' + ).resolves({ ciphertext: '' }); const result = await MessageEncrypter.encrypt( TestUtils.generateFakePubKey(),