2
0
mirror of https://github.com/tenrok/vue-native-websocket.git synced 2026-06-08 07:32:26 +03:00

Api updates (#7)

* move all instantiation options into the opts hash

* 2.0.0
This commit is contained in:
Nathan
2017-07-07 09:47:01 -07:00
committed by GitHub
parent b62cc5a27c
commit 46e251dcbc
8 changed files with 68 additions and 21 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ describe("Main.js", () =>{
it ('can be bound to the onopen event', (done) => {
mockServer = new Server('ws://localhost:8080')
Vue.use(VueNativeSock, 'ws://localhost:8080', null)
Vue.use(VueNativeSock, 'ws://localhost:8080')
let vm = new Vue()
vm.$options.sockets.onopen = (data) => {
expect(data.type).to.equal('open')
+4 -2
View File
@@ -37,7 +37,8 @@ describe ("Observer.js", () => {
Vue.use(VueNativeSock, wsUrl)
let vm = new Vue()
observer = new Observer(wsUrl, null, mockStore.object, {
observer = new Observer(wsUrl, {
store: mockStore.object,
format: 'json',
websocket: new WebSocket(wsUrl)
})
@@ -62,7 +63,8 @@ describe ("Observer.js", () => {
Vue.use(VueNativeSock, wsUrl)
let vm = new Vue()
observer = new Observer(wsUrl, null, mockStore.object, {
observer = new Observer(wsUrl, {
store: mockStore.object,
format: 'json',
websocket: new WebSocket(wsUrl)
})