Skip to content

Commit f99996d

Browse files
authored
* Refactored Pub/Sub samples into nice command-line programs, like the new Cloud Storage samples (#164)
* Brought Pub/Sub samples code coverage up to 98.66%
1 parent 5f9b9c2 commit f99996d

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

vision/samples/system-test/faceDetection.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ describe('vision:faceDetection', function () {
5555
outputFile,
5656
MockCanvas,
5757
function (err, faces) {
58-
assert(!err);
58+
assert.ifError(err);
5959
assert(faces.length === 1);
6060
var image = fs.readFileSync(outputFile);
6161
assert(image.toString('utf8') === 'testfoobar');

vision/samples/system-test/labelDetection.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ describe('vision:labelDetection', function () {
2222
labelDetectionSample.main(
2323
inputFile,
2424
function (err, labels) {
25-
assert(!err);
25+
assert.ifError(err);
2626
assert(labels.length > 0);
2727
assert(console.log.calledWith('Found label: cat for ' + inputFile));
2828
done();

vision/samples/system-test/landmarkDetection.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ var inputFile = 'https://cloud-samples-tests.storage.googleapis.com/vision/water
1919
describe('vision:landmarkDetection', function () {
2020
it('should detect landmarks', function (done) {
2121
landmarkDetectionSample.main(inputFile, function (err, landmarks) {
22-
assert(!err);
22+
assert.ifError(err);
2323
assert(landmarks.length > 0);
2424
assert(console.log.calledWith('Found landmark: Taitung, Famous Places "up the water flow" marker for ' + inputFile));
2525
done();

vision/samples/system-test/textDetection.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ var textDetectionSample = require('../textDetection');
2020
describe('vision:textDetection', function () {
2121
it('should detect texts', function (done) {
2222
textDetectionSample.main(inputDir, function (err, textResponse) {
23-
assert(!err);
23+
assert.ifError(err);
2424
assert(Object.keys(textResponse).length > 0);
2525
textDetectionSample.lookup(['the', 'sunbeams', 'in'], function (err, hits) {
26-
assert(!err);
26+
assert.ifError(err);
2727
assert(hits.length > 0);
2828
assert(hits[0].length > 0);
2929
done();

0 commit comments

Comments
 (0)