diff --git a/src/document.js b/src/document.js index 6b9925d5e..935767e35 100644 --- a/src/document.js +++ b/src/document.js @@ -121,6 +121,16 @@ class GeoPoint { return this._longitude; } + /** + * Returns a string representation for this GeoPoint. + * + * @return {string} The string representation. + */ + toString() { + return `GeoPoint { latitude: ${this.latitude}, longitude: ${this + .longitude} }`; + } + /** * Converts the GeoPoint to a google.type.LatLng proto. * @private diff --git a/test/index.js b/test/index.js index 0df51e2c7..04b0730a3 100644 --- a/test/index.js +++ b/test/index.js @@ -490,8 +490,12 @@ describe('snapshot_() method', function() { // We specifically test the GeoPoint properties to ensure 100% test // coverage. - assert.equal(50.1430847, data.geoPointValue.latitude); - assert.equal(-122.947778, data.geoPointValue.longitude); + assert.equal(data.geoPointValue.latitude, 50.1430847); + assert.equal(data.geoPointValue.longitude, -122.947778); + assert.equal( + data.geoPointValue.toString(), + 'GeoPoint { latitude: 50.1430847, longitude: -122.947778 }' + ); } beforeEach(function() {