Use stub instead of replace

pull/1238/head
Maxim Shishmarev 5 years ago
parent 1d1a62e683
commit 9b2f11b860

@ -52,11 +52,10 @@ describe('MessageEncrypter', () => {
it('should return a MEDIUM_GROUP_CIPHERTEXT envelope type', async () => { it('should return a MEDIUM_GROUP_CIPHERTEXT envelope type', async () => {
const data = crypto.randomBytes(10); const data = crypto.randomBytes(10);
sandbox.replace( sandbox.stub(
Ratchet, Ratchet,
'encryptWithSenderKey', 'encryptWithSenderKey'
sinon.fake.returns({ ciphertext: '' }) ).resolves({ ciphertext: '' });
);
const result = await MessageEncrypter.encrypt( const result = await MessageEncrypter.encrypt(
TestUtils.generateFakePubKey(), TestUtils.generateFakePubKey(),

Loading…
Cancel
Save