forked from karma-runner/karma
-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.js
34 lines (29 loc) · 737 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* globals plus */
describe('plus', function () {
// super hacky way to get the actual socket to manipulate it...
function socket () {
return window.parent.karma.socket
}
it('should pass', function () {
// In flaky fails we probably get two starts.
console.log('============== START TEST ==============')
expect(1).toBe(1)
})
it('should disconnect', function (done) {
expect(2).toBe(2)
setTimeout(() => {
socket().disconnect()
done()
}, 500)
})
it('should work', function () {
expect(plus(1, 2)).toBe(3)
})
it('should re-connect', function () {
expect(4).toBe(4)
socket().connect()
})
it('should work', function () {
expect(plus(3, 2)).toBe(5)
})
})