-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updates client library, cleans up JS, fixes package.js so the tests run #698
Conversation
Codecov Report
@@ Coverage Diff @@
## master #698 +/- ##
=======================================
Coverage 55.17% 55.17%
=======================================
Files 1 1
Lines 58 58
=======================================
Hits 32 32
Misses 26 26 Continue to review full report at Codecov.
|
Adds the following test fixes:
|
iot/manager/manager.js
Outdated
@@ -104,7 +104,7 @@ function lookupRegistry (client, registryId, projectId, cloudRegion, cb) { | |||
console.log(err); | |||
} else { | |||
console.log('Looked up existing registry'); | |||
console.log(data); | |||
console.log(data.data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Calling this data.data
is confusing. The callback argument should be named res
, or response
, as it contains an HTTP response object.
iot/manager/manager.js
Outdated
const discoveryUrl = | ||
`${DISCOVERY_API}?version=${API_VERSION}`; | ||
|
||
if (authClient.createScopedRequired && authClient.createScopedRequired()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to do this :) Just pass the list of scopes into the getClient
method:
google.auth.getClient({
scopes: ['https://www.googleapis.com/auth/cloud-platform']
}).then(auth => {
google.options({ auth });
google.discoverAPI(....
});
iot/mqtt_example/package.json
Outdated
"ava": "0.25.0", | ||
"jsonwebtoken": "8.2.0", | ||
"mqtt": "2.16.0", | ||
"uuid": "3.2.1", | ||
"yargs": "11.0.0" | ||
}, | ||
"testDependencies": {}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe testDependencies
are a thing :)
iot/manager/manager.js
Outdated
auth: authClient | ||
}); | ||
|
||
google.discoverAPI(discoveryUrl).then((client, err) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the second param here would be an error. That's traditionally where you would use a .catch()
:)
iot/mqtt_example/package.json
Outdated
"dependencies": { | ||
"@google-cloud/pubsub": "0.16.4", | ||
"@google-cloud/nodejs-repo-tools": "2.2.1", | ||
"@google-cloud/nodejs-repo-tools": "1.4.17", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why downgrade repo tools?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
samples command is in 1.x? This affects the packages.json syntax for test
-- couldn't find one for 2.2.1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jmdobry whatup?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I blame myself, I didn't really look very hard.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found it, will commit with update to runner / repo tools
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Change-Id: I4e604288729e77a2bc8a31c749a89ee662cb3ff8 Fixes #698 🦕
Change-Id: I4e604288729e77a2bc8a31c749a89ee662cb3ff8 Fixes #698 🦕
Change-Id: I4e604288729e77a2bc8a31c749a89ee662cb3ff8 Fixes #698 🦕
Change-Id: I4e604288729e77a2bc8a31c749a89ee662cb3ff8 Fixes #698 🦕
Change-Id: I4e604288729e77a2bc8a31c749a89ee662cb3ff8 Fixes #698 🦕
No description provided.