I'm trying to test sails socket connections from mocha.
var socketIOClient = require('socket.io-client');
var sailsIOClient = require('sails.io.js');
// Instantiate the socket client (`io`)
// (for now, you must explicitly pass in the socket.io client when using this library from Node.js)
var io = sailsIOClient(socketIOClient);
// Set some options:
// (you have to specify the host and port of the Sails backend when using this library from Node.js)
io.sails.url = 'http://localhost:1337';
It gives an error
Uncaught Error: The provided socket.io client (io) has already been augmented into a Sails socket SDK instance (it has io.sails).
Am I doing something wrong? sails version 0.12.3, socket.io-client 1.4.6
Your problem is posible because you have install multiples sails.io.js
You should view this line of code the sails.io.js
review your code
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With