* [html5] update webSocket formate

Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/8bc53ca3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/8bc53ca3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/8bc53ca3

Branch: refs/heads/0.15-dev
Commit: 8bc53ca36f3b07033df3f6bcfbb53189327ccd39
Parents: cfcf769
Author: erha19 <faterr...@gmail.com>
Authored: Thu Jul 13 14:39:43 2017 +0800
Committer: erha19 <faterr...@gmail.com>
Committed: Thu Jul 13 14:39:43 2017 +0800

----------------------------------------------------------------------
 html5/test/render/vue/modules/websocket.js | 31 +++++++++++--------------
 1 file changed, 13 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/8bc53ca3/html5/test/render/vue/modules/websocket.js
----------------------------------------------------------------------
diff --git a/html5/test/render/vue/modules/websocket.js 
b/html5/test/render/vue/modules/websocket.js
index d5a3c0d..05a2fca 100644
--- a/html5/test/render/vue/modules/websocket.js
+++ b/html5/test/render/vue/modules/websocket.js
@@ -18,11 +18,10 @@
  */
 import websocket from '../../../../render/vue/modules/websocket/websocket'
 const TestUrl = 'ws://echo.websocket.org'
-/** @test {webSocket module} */
-describe('webSocket module', () => {
-
-  describe('extends Standard WebSocket API', () => {
-    context('should inherit', () => {
+  /** @test {webSocket module} */
+describe('webSocket module', function () {
+  describe('extends Standard WebSocket API', function () {
+    context('should inherit', function () {
       let ws = null
       before(() => {
         ws = websocket.WebSocket(TestUrl)
@@ -48,45 +47,41 @@ describe('webSocket module', () => {
         expect(websocket, 'should INSTANCE to be 
defined').to.have.property('INSTANCE')
       })
     })
-    context('should forward native events', () => {
+    context('should forward native events', function () {
       let ws = null
       before(() => {
-        ws = websocket.WebSocket(TestUrl,'')
+        ws = websocket.WebSocket(TestUrl, '')
       })
       after(() => {
         websocket.close()
       })
       it('open', function () {
-        const open  = () => {
-        }
+        const open = () => {}
         websocket.onopen = open
         expect(ws.onopen).to.be.deep.equal(open)
       })
       it('close', function () {
-        const close  = () => {
-        }
+        const close = () => {}
         websocket.onclose = close
         expect(ws.onclose).to.be.deep.equal(close)
       })
       it('error', function () {
-        const error  = () => {
-        }
+        const error = () => {}
         websocket.onerror = error
         expect(ws.onerror).to.be.deep.equal(error)
       })
       it('message', function () {
-        const message  = () => {
-        }
+        const message = () => {}
         websocket.onmessage = message
         expect(ws.onmessage).to.be.deep.equal(message)
       })
     })
-    describe('should ignore', () => {
-      it('url is undefined', function (done) {
+    describe('should ignore', function () {
+      it('url is undefined', (done) => {
         websocket.WebSocket('')
         expect(websocket.INSTANCE).to.be.null
       })
-      it('both url and protocol is defined', function (done) {
+      it('both url and protocol is defined', (done) => {
         websocket.WebSocket(TestUrl, 'ws')
         expect(websocket.INSTANCE).not.to.be.null
       })

Reply via email to