Skip to content

Commit

Permalink
EXAMPLES: add expectation for errors
Browse files Browse the repository at this point in the history
see #32
  • Loading branch information
maxkoryukov committed Feb 5, 2017
1 parent d20b2b6 commit 90cd838
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/Geocoding/forward-geocode-address.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ helper.describeIntegration(helper.toSuiteName(__filename), function T() {
debug("error ", err)
debug("result ", coordinates)

// Several expectations about result
// Expectations about result
expect(err).is.null

expect(coordinates).is.not.empty
expect(coordinates).to.have.length.at.least(1)

Expand Down
3 changes: 3 additions & 0 deletions examples/Optimizations/get-an-optimization.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ helper.describeIntegration(helper.toSuiteName(__filename), function T() {
debug("error ", err)
debug("result ", optimization)

// Expectations about result
expect(err).is.null

expect(optimization).has.property("optimization_problem_id", "07372F2CF3814EC6DFFAFE92E22771AA")

// TODO: remove `done` call from examples
Expand Down
3 changes: 3 additions & 0 deletions examples/Routes/get-a-route.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ helper.describeIntegration(helper.toSuiteName(__filename), function T() {
debug("error ", err)
debug("result ", route)

// Expectations about result
expect(err).is.null

expect(route).has.property("route_id", "C896D0DB99C57B483D9F51B97260DCB5")

// TODO: remove `done` call from examples
Expand Down
3 changes: 3 additions & 0 deletions examples/Tracking/get-route-tracking-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ helper.describeIntegration(helper.toSuiteName(__filename), function T() {
debug("error ", err)
debug("result ", route)

// Expectations about result
expect(err).is.null

expect(route).is.not.empty
expect(route).has.property("route_id", "32F63FD03B08A5754CF2D516198FC8BA")
expect(route).has.property("tracking_history")
Expand Down

0 comments on commit 90cd838

Please sign in to comment.