Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix #54: Add end() method to Client.

  • Loading branch information...
commit 142e09347510e32dfafb1fd1bad6f3f25e6d1d9b 1 parent a3fea60
@reid reid authored
Showing with 19 additions and 1 deletion.
  1. +6 −0 doc/api/index.mustache
  2. +12 −0 lib/client.js
  3. +1 −1  test/functional.js
View
6 doc/api/index.mustache
@@ -113,6 +113,12 @@ Emitted when an Agent requests a page (test or capture) from the connected Hub.
Begin the connection to the Hub.
</p>
+<h4>client.end()</h4>
+
+<p>
+End the connection to the Hub.
+</p>
+
<h4>client.createBatch([configuration])</h4>
<p>
View
12 lib/client.js
@@ -199,6 +199,18 @@ Client.prototype.connect = function (cb) {
};
/**
+ * Disconnect from the Yeti Hub.
+ *
+ * @method end
+ */
+Client.prototype.end = function () {
+ if (!this.session) {
+ throw new Error("Session not started.");
+ }
+ this.session.end();
+};
+
+/**
* @method handleBlizzardError
* @protected
*/
View
2  test/functional.js
@@ -265,7 +265,7 @@ function attachServerContext(testContext, explicitRoute) {
topic: hub.clientTopic(route + "/"),
teardown: function (topic) {
// TODO Add end method, bug #54.
- // topic.client.end();
+ topic.client.end();
},
"a browser for testing": {
topic: hub.phantomTopic(),
Please sign in to comment.
Something went wrong with that request. Please try again.