var Socket = require('../')
var test = require('tape')

test('basic echo test', function (t) {
  t.plan(3)

  var socket = new Socket('wss://echo.websocket.org')
  socket.on('ready', function () {
    t.pass('ready emitted')
    socket.send('sup!')
    socket.on('message', function (data) {
      t.equal(data, 'sup!')
      socket.destroy(function () {
        t.pass('destroyed socket')
      })
    })
  })
})

@@ -53,28 +53,70 @@
 ')%0A%0A
+var SOCKET_SERVER = 'wss://echo.websocket.org'%0A%0A
 test('
-basic 
 echo te
-s
+x
 t', 
@@ -173,34 +173,369 @@
 ket(
-'wss://echo.websocket.org'
+SOCKET_SERVER)%0A  socket.on('ready', function () %7B%0A    t.pass('ready emitted')%0A    socket.send('sup!')%0A    socket.on('message', function (data) %7B%0A      t.equal(data, 'sup!')%0A%0A      socket.destroy(function () %7B%0A        t.pass('destroyed socket')%0A      %7D)%0A    %7D)%0A  %7D)%0A%7D)%0A%0Atest('echo binary data', function (t) %7B%0A  t.plan(3)%0A%0A  var socket = new Socket(SOCKET_SERVER
 )%0A  
@@ -603,38 +603,57 @@
     socket.send(
-'sup!'
+new Uint8Array(%5B1, 2, 3%5D)
 )%0A    socket.on(
@@ -689,36 +689,131 @@
       t.
-equal(data, 'sup!
+ok(Buffer.isBuffer(data), 'data is Buffer')%0A      t.deepEqual(data, new Buffer(%5B1, 2, 3%5D), 'got correct message
 ')%0A
+%0A
       so

add failing test for binary data