Skip to content

Commit 726d602

Browse files
authored
Switch from Mocha to Ava for faster tests (#289)
* Switch from Mocha to Ava * Concurrency: 5
1 parent 1b8636f commit 726d602

File tree

3 files changed

+7
-54
lines changed

3 files changed

+7
-54
lines changed

packages/google-cloud-vision/samples/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
"license": "Apache Version 2.0",
66
"author": "Google Inc.",
77
"scripts": {
8-
"test": "cd ..; npm run t -- vision/test/*.test.js",
9-
"system-test": "cd ..; npm run st -- vision/system-test/*.test.js"
8+
"test": "cd ..; npm run st -- vision/system-test/*.test.js"
109
},
1110
"dependencies": {
1211
"@google-cloud/vision": "0.7.0",

packages/google-cloud-vision/samples/quickstart.js

+6-8
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,11 @@ const visionClient = Vision({
3131
const fileName = './resources/wakeupcat.jpg';
3232

3333
// Performs label detection on the image file
34-
visionClient.detectLabels(fileName, (err, labels) => {
35-
if (err) {
36-
console.error(err);
37-
return;
38-
}
34+
visionClient.detectLabels(fileName)
35+
.then((results) => {
36+
const labels = results[0];
3937

40-
console.log('Labels:');
41-
labels.forEach((label) => console.log(label));
42-
});
38+
console.log('Labels:');
39+
labels.forEach((label) => console.log(label));
40+
});
4341
// [END vision_quickstart]

packages/google-cloud-vision/samples/test/quickstart.test.js

-44
This file was deleted.

0 commit comments

Comments
 (0)