mirror of
https://github.com/tenrok/vue-native-websocket.git
synced 2026-05-25 05:44:05 +03:00
46e251dcbc
* move all instantiation options into the opts hash * 2.0.0
22 lines
450 B
JavaScript
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)
|
|
}
|
|
})
|
|
|
|
})
|
|
|