Created
June 12, 2018 19:44
-
-
Save dwalleck/9a69474a5413af9026e526c6838f6be4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const index = require('../index'); | |
const event = require ('../event.json'); | |
const Compute = require('@google-cloud/compute'); | |
const Bluebird = require('bluebird'); | |
jest.mock('bluebird'); | |
jest.mock('@google-cloud/compute', () => { | |
return jest.fn().mockImplementation(() => { | |
return { | |
getVMsAsync: jest.fn(), | |
getAddressesAsync: jest.fn(), | |
getDisksAsync: jest.fn(), | |
getFirewallsAsync: jest.fn(), | |
getNetworksAsync: jest.fn(), | |
getSnapshotsAsync: jest.fn(), | |
getSubnetworksAsync: jest.fn() | |
}; | |
}); | |
}); | |
describe('aws-resource-collector', () => { | |
it('processes a valid event', (done) => { | |
Bluebird.promisifyAll.mockImplementation((req) => req); | |
index.handle(event, null, (err, msg) => { | |
console.log(err, msg); | |
}) | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment