test-agent
Advanced tools
Comparing version 0.5.0 to 0.5.1
@@ -0,1 +1,6 @@ | ||
# 0.5.1 | ||
- Added option to specify websocket server in test-agent test | ||
- Fixed issue where websocket client would try to send when connection | ||
is closed. | ||
# 0.5.0 | ||
@@ -2,0 +7,0 @@ - Test UI button will now show busy when tests are running. |
var Client = require('../../node/client'), | ||
Apps = require('../../node/server'), | ||
url = 'ws://localhost:8789', | ||
optimist = require('optimist'), | ||
@@ -9,3 +8,2 @@ argv, | ||
client = new Client({ | ||
url: url, | ||
retry: true | ||
@@ -38,2 +36,6 @@ }); | ||
}). | ||
option('server', { | ||
desc: 'Location of the websocket server to connect to.', | ||
default: 'ws://localhost:8789' | ||
}). | ||
argv; | ||
@@ -52,2 +54,4 @@ | ||
client.url = argv.server; | ||
client.on('open', function(socket) { | ||
@@ -54,0 +58,0 @@ var files = argv._.slice(1), |
@@ -51,2 +51,6 @@ //depends on TestAgent.Responder | ||
this.on('open', this._setConnectionStatus.bind(this, true)); | ||
this.on('close', this._setConnectionStatus.bind(this, false)); | ||
this.on('close', this._incrementRetry.bind(this)); | ||
@@ -66,2 +70,11 @@ this.on('message', this._processMessage.bind(this)); | ||
/** | ||
* True when connection is opened. | ||
* Used to ensure messages are not sent | ||
* when connection to server is closed. | ||
* | ||
* @type Boolean | ||
*/ | ||
Client.prototype.connectionOpen = false; | ||
//Retry | ||
@@ -104,3 +117,5 @@ Client.prototype.retry = false; | ||
Client.prototype.send = function send(event, data) { | ||
this.socket.send(this.stringify(event, data)); | ||
if (this.connectionOpen) { | ||
this.socket.send(this.stringify(event, data)); | ||
} | ||
}; | ||
@@ -143,2 +158,12 @@ | ||
/** | ||
* Sets connectionOpen. | ||
* | ||
* @param {Boolean} type connection status. | ||
*/ | ||
Client.prototype._setConnectionStatus = _setConnectionStatus; | ||
function _setConnectionStatus(type) { | ||
this.connectionOpen = type; | ||
} | ||
if (isNode) { | ||
@@ -145,0 +170,0 @@ module.exports = Client; |
{ | ||
"name": "test-agent", | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"author": "James Lal", | ||
@@ -5,0 +5,0 @@ "description": "execute client side tests from browser report back to cli", |
@@ -7,3 +7,5 @@ (function(window) { | ||
worker.use(TestAgent.BrowserWorker.Websocket); | ||
worker.use(TestAgent.BrowserWorker.Websocket, { | ||
url: 'ws://' + window.location.host | ||
}); | ||
@@ -10,0 +12,0 @@ worker.use(TestAgent.BrowserWorker.Config, { |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
24
302350
68
10645