Skip to content

Commit

Permalink
chore: assert.deelEqual => assert.deepStrictEqual (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkwlui authored and JustinBeckwith committed Jul 30, 2018
1 parent bf0c07d commit 17ef347
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions packages/google-cloud-vision/system-test/vision.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,22 +83,22 @@ describe('Vision', function() {
var url = 'https://upload.wikimedia.org/wikipedia/commons/5/51/Google.png';
return client.logoDetection(url).then(responses => {
var response = responses[0];
assert.deepEqual(response.logoAnnotations[0].description, 'Google');
assert.deepStrictEqual(response.logoAnnotations[0].description, 'Google');
});
});

it('should detect from a filename', () => {
return client.logoDetection(IMAGES.logo).then(responses => {
var response = responses[0];
assert.deepEqual(response.logoAnnotations[0].description, 'Google');
assert.deepStrictEqual(response.logoAnnotations[0].description, 'Google');
});
});

it('should detect from a Buffer', () => {
var buffer = fs.readFileSync(IMAGES.logo);
return client.logoDetection(buffer).then(responses => {
var response = responses[0];
assert.deepEqual(response.logoAnnotations[0].description, 'Google');
assert.deepStrictEqual(response.logoAnnotations[0].description, 'Google');
});
});

Expand Down
30 changes: 15 additions & 15 deletions packages/google-cloud-vision/test/helpers.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe('Vision helper methods', () => {
let response = r[0];

// Ensure that we got the slice of the response that we expected.
assert.deepEqual(response, {
assert.deepStrictEqual(response, {
logoAnnotations: [{description: 'Google'}],
});

Expand Down Expand Up @@ -91,14 +91,14 @@ describe('Vision helper methods', () => {
let response = r[0];

// Ensure that we got the slice of the response that we expected.
assert.deepEqual(response, {
assert.deepStrictEqual(response, {
logoAnnotations: [{description: 'Google'}],
});

// Inspect the calls to batchAnnotateImages and ensure they matched
// the expected signature.
assert(batchAnnotate.callCount === 1);
assert.deepEqual(request, {
assert.deepStrictEqual(request, {
image: {content: 'ZmFrZUltYWdl'},
features: {type: ['LOGO_DETECTION']},
});
Expand Down Expand Up @@ -137,7 +137,7 @@ describe('Vision helper methods', () => {
let response = r[0];

// Ensure that we got the slice of the response that we expected.
assert.deepEqual(response, {
assert.deepStrictEqual(response, {
logoAnnotations: [{description: 'Google'}],
});

Expand All @@ -149,7 +149,7 @@ describe('Vision helper methods', () => {
// Inspect the calls to batchAnnotateImages and ensure they matched
// the expected signature.
assert(batchAnnotate.callCount === 1);
assert.deepEqual(request, {
assert.deepStrictEqual(request, {
image: {content: 'ZmFrZUltYWdl'},
features: {type: ['LOGO_DETECTION']},
});
Expand All @@ -176,7 +176,7 @@ describe('Vision helper methods', () => {
.annotateImage(request)
.then(assert.fail)
.catch(err => {
assert.deepEqual(err, {error: 404});
assert.deepStrictEqual(err, {error: 404});
});
});

Expand All @@ -201,7 +201,7 @@ describe('Vision helper methods', () => {
let response = r[0];

// Ensure that we got the slice of the response that we expected.
assert.deepEqual(response, {
assert.deepStrictEqual(response, {
logoAnnotations: [{description: 'Google'}],
});

Expand Down Expand Up @@ -232,7 +232,7 @@ describe('Vision helper methods', () => {
client.annotateImage(request, function(err, response) {
// Establish that we got the expected response.
assert(is.undefined(err));
assert.deepEqual(response, {
assert.deepStrictEqual(response, {
logoAnnotations: [{description: 'Google'}],
});

Expand All @@ -257,7 +257,7 @@ describe('Vision helper methods', () => {
};
return client.annotateImage(request).catch(err => {
// Establish that we got the expected response.
assert.deepEqual(err, {message: 'Bad things!'});
assert.deepStrictEqual(err, {message: 'Bad things!'});

// Inspect the calls to batchAnnotate and ensure that they match
// what we expected.
Expand Down Expand Up @@ -298,7 +298,7 @@ describe('Vision helper methods', () => {
let response = r[0];

// Ensure that we got the slice of the response that we expected.
assert.deepEqual(response, {
assert.deepStrictEqual(response, {
logoAnnotations: [{description: 'Google'}],
});

Expand Down Expand Up @@ -338,7 +338,7 @@ describe('Vision helper methods', () => {
let response = r[0];

// Ensure we got the slice of the response that we expected.
assert.deepEqual(response, {
assert.deepStrictEqual(response, {
logoAnnotations: [{description: 'Google'}],
});

Expand Down Expand Up @@ -370,7 +370,7 @@ describe('Vision helper methods', () => {
// Call a request to a single-feature method using a URL.
return client.logoDetection('/path/to/logo.png').then(response => {
// Ensure we got the slice of the response that we expected.
assert.deepEqual(response, [
assert.deepStrictEqual(response, [
{
logoAnnotations: [{description: 'Google'}],
},
Expand Down Expand Up @@ -407,7 +407,7 @@ describe('Vision helper methods', () => {
let response = r[0];

// Ensure that we got the slice of the response that we expected.
assert.deepEqual(response, {
assert.deepStrictEqual(response, {
logoAnnotations: [{description: 'Google'}],
});

Expand Down Expand Up @@ -445,7 +445,7 @@ describe('Vision helper methods', () => {
// to ensure that sending call options works appropriately.
return client.logoDetection(Buffer.from('fakeImage'), opts).then(r => {
let response = r[0];
assert.deepEqual(response, {
assert.deepStrictEqual(response, {
logoAnnotations: [{description: 'Google'}],
});

Expand Down Expand Up @@ -502,7 +502,7 @@ describe('Vision helper methods', () => {
.then(r => {
let response = r[0];

assert.deepEqual(response, {
assert.deepStrictEqual(response, {
localizedObjectAnnotations: [{dummy: 'response'}],
});

Expand Down

0 comments on commit 17ef347

Please sign in to comment.