docs(samples): updated samples code to use async/await and tests to use mocha#241
Conversation
b3f101c to
c34c822
Compare
Codecov Report
@@ Coverage Diff @@
## master #241 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 2 2
Lines 83 83
=====================================
Hits 83 83Continue to review full report at Codecov.
|
| .catch(err => { | ||
| console.error('ERROR:', err); | ||
| }); | ||
| const [{faceAnnotations: faces}] = await client.faceDetection(fileName); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| }); | ||
| pngStream.on('error', console.log); | ||
| pngStream.on('end', () => { | ||
| return; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| // Run the example | ||
| // [START vision_face_detection_tutorial_run_application] | ||
| function main(inputFile, outputFile, Canvas, callback) { | ||
| async function main(inputFile, outputFile, Canvas, callback) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| .catch(err => { | ||
| console.error('ERROR:', err); | ||
| }); | ||
| (async () => { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| async function lookup(words) { | ||
| const index = new Index(); | ||
| index.lookup(words, function(err, hits) { | ||
| try { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
@JustinBeckwith 'll add fix for samples/faceDetection.js shortly. I may need to change tests as well here. |
de7dba8 to
d0a0001
Compare
| function main(inputDir, callback) { | ||
| const index = new Index(); | ||
| function main(inputDir) { | ||
| return new Promise((resolve, reject) => { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
e9fda27 to
891052c
Compare
|
@vijay-qlogic as soon as the samples-tests are passing we can merge this :) |
|
Just a reminder/ping to address the failing sample tests |
|
Yes, I'm looking into it.. Facing some challenges to resolve the issues here. |
|
Anything I can do to help? Can you run the sample tests locally on your own? |
|
With ava, tests run successfully, but asks for redis-server with mocha... |
f9f67ca to
be0e660
Compare
687f865 to
9ea91ca
Compare
|
It looks like the sample tests are still failing: |
e9cd363 to
1d76f10
Compare
Fixes googleapis/google-cloud-node/issues/2869 (it's a good idea to open an issue first for discussion)