2
0
mirror of https://github.com/tenrok/vue-native-websocket.git synced 2026-05-25 14:44:05 +03:00
Files
vue-native-websocket/test/unit/specs/Main.spec.js
T
Nathan 46e251dcbc Api updates (#7)
* move all instantiation options into the opts hash

* 2.0.0
2017-07-07 09:47:01 -07:00

22 lines
450 B
JavaScript

import Vue from 'vue'
import VueNativeSock from '@/Main'
import { Server } from 'mock-socket'
describe("Main.js", () =>{
let mockServer
it ('can be bound to the onopen event', (done) => {
mockServer = new Server('ws://localhost:8080')
Vue.use(VueNativeSock, 'ws://localhost:8080')
let vm = new Vue()
vm.$options.sockets.onopen = (data) => {
expect(data.type).to.equal('open')
mockServer.stop(done)
}
})
})