Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('disk create should fail if promise throws', function () {
sandbox.restore();
sandbox.stub(GcpCompute.prototype, 'zone').returns(zoneFailedStub);
return client.createDiskFromSnapshot(snapshotName, zone)
.then(() => {
throw new Error('expected disk create request to fail');
})
.catch(err => expect(err.message).to.eql(createDiskFailedMsg));
});
beforeEach(function () {
sandbox = sinon.createSandbox();
client = new GcpClient(settings);
sandbox.stub(GcpCompute.prototype, 'snapshot').returns(snapshotStub);
sandbox.stub(GcpCompute.prototype, 'zone').returns(zoneStub);
sandbox.stub(GcpClient.prototype, 'getRandomDiskId').returns(diskName);
});
afterEach(function () {