diff --git a/packages/google-cloud-vision/samples/package.json b/packages/google-cloud-vision/samples/package.json index a3c4fcca669..a11a974dfd4 100644 --- a/packages/google-cloud-vision/samples/package.json +++ b/packages/google-cloud-vision/samples/package.json @@ -8,7 +8,7 @@ "node": ">=8" }, "scripts": { - "test": "ava -T 1m --verbose system-test/*.test.js" + "test": "mocha system-test/*.test.js --timeout 600000" }, "dependencies": { "@google-cloud/automl": "^0.1.1", @@ -22,9 +22,7 @@ "devDependencies": { "@google-cloud/nodejs-repo-tools": "^3.0.0", "@google-cloud/storage": "^2.0.0", - "ava": "^0.25.0", - "proxyquire": "^2.0.1", - "sinon": "^7.0.0", + "mocha": "^5.0.0", "uuid": "^3.2.1" }, "optionalDependencies": { diff --git a/packages/google-cloud-vision/samples/quickstart.js b/packages/google-cloud-vision/samples/quickstart.js index 9afcff3dcc0..5613b0f6298 100644 --- a/packages/google-cloud-vision/samples/quickstart.js +++ b/packages/google-cloud-vision/samples/quickstart.js @@ -23,15 +23,13 @@ const vision = require('@google-cloud/vision'); const client = new vision.ImageAnnotatorClient(); // Performs label detection on the image file -client - .labelDetection('./resources/wakeupcat.jpg') - .then(results => { - const labels = results[0].labelAnnotations; - - console.log('Labels:'); - labels.forEach(label => console.log(label.description)); - }) - .catch(err => { - console.error('ERROR:', err); - }); +async function main() { + const [result] = await client.labelDetection('./resources/wakeupcat.jpg'); + const labels = result.labelAnnotations; + console.log('Labels:'); + labels.forEach(label => console.log(label.description)); +} +main().catch(err => { + console.error('ERROR:', err); +}); // [END vision_quickstart]