Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
before(function() {
mockery.registerMock('google-auto-auth', fakeGoogleAutoAuth);
mockery.registerMock('request', fakeRequest);
mockery.registerMock('retry-request', fakeRetryRequest);
mockery.registerMock('stream-events', fakeStreamEvents);
mockery.enable({
useCleanCache: true,
warnOnUnregistered: false
});
util = require('../../lib/common/util');
var utilCached = extend(true, {}, util);
// Override all util methods, allowing them to be mocked. Overrides are
// removed before each test.
Object.keys(util).forEach(function(utilMethod) {
if (typeof util[utilMethod] !== 'function') {
return;
}
before(function() {
mockery.registerMock(
'../../lib/common/service-object.js',
FakeServiceObject
);
mockery.enable({
useCleanCache: true,
warnOnUnregistered: false
});
Project = require('../../lib/resource/project.js');
});
before(function() {
mockery.registerMock(
'../../lib/common/service-object.js',
FakeServiceObject
);
mockery.enable({
useCleanCache: true,
warnOnUnregistered: false
});
GrpcServiceObject = require('../../lib/common/grpc-service-object.js');
});
before(function() {
mockery.registerMock(
'../../lib/common/service-object.js',
FakeServiceObject
);
mockery.enable({
useCleanCache: true,
warnOnUnregistered: false
});
Firewall = require('../../lib/compute/firewall.js');
});
before(function() {
mockery.registerMock(
'../../lib/common/service-object.js',
FakeServiceObject
);
mockery.enable({
useCleanCache: true,
warnOnUnregistered: false
});
Channel = require('../../lib/storage/channel.js');
});
before(function() {
mockery.registerMock(
'../../lib/common/service-object.js',
FakeServiceObject
);
mockery.registerMock('../../lib/common/stream-router.js', fakeStreamRouter);
mockery.registerMock('../../lib/search/document.js', FakeDocument);
mockery.enable({
useCleanCache: true,
warnOnUnregistered: false
});
Index = require('../../lib/search/index-class.js');
});
before(function() {
mockery.registerMock('request', fakeRequest);
mockery.registerMock('../../lib/storage/file.js', FakeFile);
mockery.registerMock('../../lib/common/service.js', FakeService);
mockery.registerMock('../../lib/common/util.js', fakeUtil);
mockery.enable({
useCleanCache: true,
warnOnUnregistered: false
});
Vision = require('../../lib/vision/index.js');
});
before(function() {
mockery.registerMock('async', fakeAsync);
mockery.registerMock('request', fakeRequest);
mockery.registerMock(
'../../lib/common/service-object.js',
FakeServiceObject
);
mockery.registerMock('../../lib/common/stream-router.js', fakeStreamRouter);
mockery.registerMock('../../lib/storage/acl.js', FakeAcl);
mockery.registerMock('../../lib/storage/file.js', FakeFile);
mockery.enable({
useCleanCache: true,
warnOnUnregistered: false
});
Bucket = require('../../lib/storage/bucket.js');
});
before(function() {
mockery.registerMock('gcs-resumable-upload', fakeResumableUpload);
mockery.registerMock('request', fakeRequest);
mockery.registerMock(
'../../lib/common/service-object.js',
FakeServiceObject
);
mockery.registerMock('../../lib/common/util.js', fakeUtil);
mockery.enable({
useCleanCache: true,
warnOnUnregistered: false
});
File = require('../../lib/storage/file.js');
duplexify = require('duplexify');
});
before(function() {
mockery.registerMock('../../lib/common/grpc-service.js', FakeGrpcService);
mockery.registerMock('../../lib/common/util.js', fakeUtil);
mockery.registerMock('../../lib/bigtable/table.js', FakeTable);
mockery.enable({
useCleanCache: true,
warnOnUnregistered: false
});
Bigtable = require('../../lib/bigtable/index.js');
});