Skip to content

Tests fail with ws 1.1+ #19

@flowersinthesand

Description

@flowersinthesand
➜  cettia-javascript-client git:(master) ✗ npm run build && npm run test

> cettia-client@1.0.0-Beta2 build /Users/donghwankim/git/cettia-javascript-client
> npm run base; npm run bundler; npm run browser; npm run browserMin


> cettia-client@1.0.0-Beta2 base /Users/donghwankim/git/cettia-javascript-client
> babel src/cettia.es6 --out-file cettia.js


> cettia-client@1.0.0-Beta2 bundler /Users/donghwankim/git/cettia-javascript-client
> NODE_ENV=browser babel src/cettia.es6 --out-file cettia-bundler.js


> cettia-client@1.0.0-Beta2 browser /Users/donghwankim/git/cettia-javascript-client
> webpack cettia-bundler.js cettia-browser.js --output-library cettia

Hash: b4020e0e204096bd69ff
Version: webpack 1.15.0
Time: 330ms
            Asset    Size  Chunks             Chunk Names
cettia-browser.js  175 kB       0  [emitted]  main
   [0] ./cettia-bundler.js 36.4 kB {0} [built]
    + 36 hidden modules

> cettia-client@1.0.0-Beta2 browserMin /Users/donghwankim/git/cettia-javascript-client
> webpack cettia-bundler.js cettia-browser.min.js --output-library cettia --optimize-minimize --optimize-occurence-order

Hash: 3fe79c98cd35f543736d
Version: webpack 1.15.0
Time: 1705ms
                Asset     Size  Chunks             Chunk Names
cettia-browser.min.js  65.8 kB       0  [emitted]  main
   [0] ./cettia-bundler.js 36.4 kB {0} [built]
    + 36 hidden modules

WARNING in cettia-browser.min.js from UglifyJs
Side effects in initialization of unused variable _traverse2 [./cettia-bundler.js:7,0]
Condition always true [./~/event-lite/event-lite.js:30,0]
Dropping unused variable MAXBUFLEN [./~/msgpack-lite/lib/buffer-lite.js:3,0]

> cettia-client@1.0.0-Beta2 test /Users/donghwankim/git/cettia-javascript-client
> grunt test

Running "test-node" task
[SECURITY] node-uuid: crypto not usable, falling back to insecure Math.random()


  client
    should open a new socket
      ✓ websocket (68ms)
      ✓ httpstream
      ✓ httplongpoll
    should close the socket
      ✓ websocket
      ✓ httpstream
      ✓ httplongpoll (3025ms)
    should exchange a text event
      ✓ websocket
      ✓ httpstream
      ✓ httplongpoll
    should exchange a binary event
      1) websocket
      ✓ httpstream
      ✓ httplongpoll
    should exchange a composite event
      2) websocket
      ✓ httpstream
      ✓ httplongpoll
    should exchange an event containing of multi-byte characters
      ✓ websocket
      ✓ httpstream
      ✓ httplongpoll
    should exchange an event of 2KB
      ✓ websocket
      ✓ httpstream
      ✓ httplongpoll
    should not lose any event in an exchange of twenty events
      ✓ websocket (38ms)
      ✓ httpstream (78ms)
      ✓ httplongpoll (133ms)
    should close the socket if heartbeat fails
      ✓ websocket (2514ms)
      ✓ httpstream (2524ms)
      ✓ httplongpoll (2517ms)
    reply
      should execute the resolve callback when receiving event
        ✓ websocket
        ✓ httpstream
        ✓ httplongpoll
      should execute the reject callback when receiving event
        ✓ websocket
        ✓ httpstream
        ✓ httplongpoll
      should execute the resolve callback when sending event
        ✓ websocket
        ✓ httpstream
        ✓ httplongpoll
      should execute the reject callback when sending event
        ✓ websocket
        ✓ httpstream
        ✓ httplongpoll


  37 passing (11s)
  2 failing

  1) client should exchange a binary event websocket:
     Uncaught Error: Invalid type: undefined
    at Codec.decode (node_modules/msgpack-lite/lib/read-core.js:24:22)
    at DecodeBuffer.fetch (node_modules/msgpack-lite/lib/decode-buffer.js:26:21)
    at DecodeBuffer.read (node_modules/msgpack-lite/lib/flex-buffer.js:166:28)
    at Object.decode (node_modules/msgpack-lite/lib/decode.js:10:18)
    at Object.<anonymous> (cettia.js:424:41)
    at _fire (cettia.js:136:25)
    at Object.fire (cettia.js:171:9)
    at Object.self.fire (cettia.js:584:18)
    at WebSocket.ws.onmessage (cettia.js:630:14)
    at WebSocket.onMessage (node_modules/ws/lib/EventTarget.js:103:16)
    at Receiver._receiver.onmessage (node_modules/ws/lib/WebSocket.js:146:54)
    at Receiver.dataMessage (node_modules/ws/lib/Receiver.js:380:14)
    at extension.decompress (node_modules/ws/lib/Receiver.js:349:40)
    at _inflate.flush (node_modules/ws/lib/PerMessageDeflate.js:314:12)
    at afterWrite (_stream_writable.js:387:3)
    at onwrite (_stream_writable.js:378:7)
    at WritableState.onwrite (_stream_writable.js:89:5)
    at afterTransform (_stream_transform.js:79:3)
    at TransformState.afterTransform (_stream_transform.js:54:12)
    at Zlib.callback (zlib.js:639:5)
  

  2) client should exchange a composite event websocket:
     Uncaught Error: Invalid type: undefined
    at Codec.decode (node_modules/msgpack-lite/lib/read-core.js:24:22)
    at DecodeBuffer.fetch (node_modules/msgpack-lite/lib/decode-buffer.js:26:21)
    at DecodeBuffer.read (node_modules/msgpack-lite/lib/flex-buffer.js:166:28)
    at Object.decode (node_modules/msgpack-lite/lib/decode.js:10:18)
    at Object.<anonymous> (cettia.js:424:41)
    at _fire (cettia.js:136:25)
    at Object.fire (cettia.js:171:9)
    at Object.self.fire (cettia.js:584:18)
    at WebSocket.ws.onmessage (cettia.js:630:14)
    at WebSocket.onMessage (node_modules/ws/lib/EventTarget.js:103:16)
    at Receiver._receiver.onmessage (node_modules/ws/lib/WebSocket.js:146:54)
    at Receiver.dataMessage (node_modules/ws/lib/Receiver.js:380:14)
    at extension.decompress (node_modules/ws/lib/Receiver.js:349:40)
    at _inflate.flush (node_modules/ws/lib/PerMessageDeflate.js:314:12)
    at afterWrite (_stream_writable.js:387:3)
    at onwrite (_stream_writable.js:378:7)
    at WritableState.onwrite (_stream_writable.js:89:5)
    at afterTransform (_stream_transform.js:79:3)
    at TransformState.afterTransform (_stream_transform.js:54:12)
    at Zlib.callback (zlib.js:639:5)
  



Warning: Task "test-node" failed. Use --force to continue.

Aborted due to warnings.

npm ERR! Darwin 16.5.0
npm ERR! argv "/Users/donghwankim/.nvm/versions/node/v6.8.1/bin/node" "/Users/donghwankim/.nvm/versions/node/v6.8.1/bin/npm" "run" "test"
npm ERR! node v6.8.1
npm ERR! npm  v3.10.9
npm ERR! code ELIFECYCLE
npm ERR! cettia-client@1.0.0-Beta2 test: `grunt test`
npm ERR! Exit status 3
npm ERR! 
npm ERR! Failed at the cettia-client@1.0.0-Beta2 test script 'grunt test'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the cettia-client package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     grunt test
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs cettia-client
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls cettia-client
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/donghwankim/git/cettia-javascript-client/npm-debug.log
➜  cettia-javascript-client git:(master) ✗ npm ls ws
cettia-client@1.0.0-Beta2 /Users/donghwankim/git/cettia-javascript-client
├─┬ cettia-protocol@1.0.0-Beta1 (git://github.com/cettia/cettia-protocol.git#6d9ca65bd0419086c31435d45d5f62b9d8a8f95d)
│ └── ws@1.0.1 
└── ws@2.3.1 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions