Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('will close a Tanker session on a device revoked while closed', async () => {
const bobPhoneDeviceId = bobPhone.deviceId;
await bobPhone.stop();
await bobLaptop.revokeDevice(bobPhoneDeviceId);
await bobPhone.start(bobIdentity);
await expect(bobPhone.encrypt('message')).to.be.rejectedWith(errors.DeviceRevoked);
expect(bobPhone.status).to.equal(statuses.STOPPED);
});