FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
node-ssdp/test/helper.js at master · JavaScriptIOT/node-ssdp · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
JavaScriptIOT
/
node-ssdp
Public
forked from
diversario/node-ssdp
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
node-ssdp
/
test
/
helper.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
45 lines (33 loc) · 890 Bytes
Breadcrumbs
node-ssdp
/
test
/
helper.js
Copy path
File metadata and controls
45 lines (33 loc) · 890 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
35
36
37
38
39
40
41
42
43
44
45
var
sinon
=
require
(
'sinon'
)
,
EE
=
require
(
'events'
)
.
EventEmitter
,
dgram
=
require
(
'dgram'
)
beforeEach
(
function
(
)
{
this
.
sinon
=
sinon
.
sandbox
.
create
(
)
;
this
.
sinon
.
stub
(
dgram
,
'createSocket'
)
.
callsFake
(
getFakeSocket
.
bind
(
this
)
)
}
)
;
afterEach
(
function
(
)
{
this
.
sinon
.
restore
(
)
;
}
)
;
function
getFakeSocket
(
)
{
var
s
=
new
EE
s
.
type
=
'udp4'
s
.
address
=
this
.
sinon
.
stub
(
)
s
.
address
.
returns
(
{
address
:
1
,
port
:
2
}
)
s
.
addMembership
=
this
.
sinon
.
stub
(
)
s
.
setMulticastTTL
=
this
.
sinon
.
stub
(
)
s
.
setMulticastLoopback
=
this
.
sinon
.
stub
(
)
s
.
unref
=
this
.
sinon
.
stub
(
)
s
.
bind
=
function
(
/*port, addr, cb*/
)
{
var
cb
=
[
]
.
slice
.
call
(
arguments
)
.
pop
(
)
if
(
typeof
cb
==
'function'
)
cb
(
)
}
this
.
sinon
.
spy
(
s
,
'bind'
)
s
.
send
=
this
.
sinon
.
stub
(
)
.
callsFake
(
function
(
)
{
s
.
emit
(
'_send_called'
)
}
)
s
.
close
=
this
.
sinon
.
stub
(
)
return
s
}
Back
|
FazBrowse Home
|
New Git URL