2
0
mirror of https://github.com/tenrok/vue-native-websocket.git synced 2026-06-21 06:30:34 +03:00
* wire up specs

* tests + fixes for #1

* travis
This commit is contained in:
Nathan
2017-07-07 09:27:32 -07:00
committed by GitHub
parent 57a33ebae5
commit b62cc5a27c
12 changed files with 1342 additions and 74 deletions
+21
View File
@@ -0,0 +1,21 @@
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', null)
let vm = new Vue()
vm.$options.sockets.onopen = (data) => {
expect(data.type).to.equal('open')
mockServer.stop(done)
}
})
})