diff --git a/functions/helloworld/index.js b/functions/helloworld/index.js index e7dd86fff9..f28776148e 100644 --- a/functions/helloworld/index.js +++ b/functions/helloworld/index.js @@ -99,7 +99,7 @@ exports.helloGCS = function (event, callback) { if (file.resourceState === 'not_exists') { console.log(`File ${file.name} deleted.`); - } else if (file.metageneration === 1) { + } else if (file.metageneration === '1') { // metageneration attribute is updated on metadata changes. // on create value is 1 console.log(`File ${file.name} uploaded.`); diff --git a/functions/helloworld/test/index.test.js b/functions/helloworld/test/index.test.js index 4812fb7928..66d0bf96ff 100644 --- a/functions/helloworld/test/index.test.js +++ b/functions/helloworld/test/index.test.js @@ -143,7 +143,7 @@ test.serial(`helloGCS: should print uploaded message`, (t) => { data: { name: `foo`, resourceState: `exists`, - metageneration: 1 + metageneration: `1` } }, callback); @@ -161,7 +161,7 @@ test.serial(`helloGCS: should print metadata updated message`, (t) => { data: { name: `foo`, resourceState: `exists`, - metageneration: 2 + metageneration: `2` } }, callback);