Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

test-agent

Package Overview
Dependencies
Maintainers
1
Versions
108
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

test-agent - npm Package Compare versions

Comparing version 0.5.0 to 0.5.1

5

HISTORY.md

@@ -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.

8

lib/node/bin/test.js
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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc