Skip to content

Commit

Permalink
fix quickstart.test.js using new export structure (#348)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkwlui authored and JustinBeckwith committed Sep 4, 2018
1 parent f323ab3 commit d6cb9b2
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions samples/system-test/quickstart.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ const test = require(`ava`);
const tools = require(`@google-cloud/nodejs-repo-tools`);
const uuid = require(`uuid`);


const {Storage} = proxyquire(`@google-cloud/storage`, {});

const storage = new Storage();
Expand All @@ -39,8 +38,8 @@ test.after.always(async () => {
test.cb(`should create a bucket`, t => {
const expectedBucketName = `my-new-bucket`;

const storageMock = {
createBucket: _bucketName => {
const StorageMock = class {
createBucket(_bucketName) {
t.is(_bucketName, expectedBucketName);

return bucket.create().then(([bucket]) => {
Expand All @@ -61,10 +60,12 @@ test.cb(`should create a bucket`, t => {

return [bucket];
});
},
}
};

proxyquire(`../quickstart`, {
'@google-cloud/storage': sinon.stub().returns(storageMock),
'@google-cloud/storage': {
Storage: StorageMock,
},
});
});

0 comments on commit d6cb9b2

Please sign in to comment.