FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
bitcore/test/test.Peer.js at master · BitTokenDev/bitcore · GitHub
BitTokenDev
bitcore
Repository navigation
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
bitcore
/
test
/
test.Peer.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
50 lines (41 loc) · 1.2 KB
Breadcrumbs
bitcore
/
test
/
test.Peer.js
Copy path
File metadata and controls
50 lines (41 loc) · 1.2 KB
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
'use strict'
;
var
chai
=
chai
||
require
(
'chai'
)
;
var
bitcore
=
bitcore
||
require
(
'../bitcore'
)
;
var
should
=
chai
.
should
(
)
;
var
PeerModule
=
bitcore
.
Peer
;
var
Peer
;
describe
(
'Peer'
,
function
(
)
{
it
(
'should initialze the main object'
,
function
(
)
{
should
.
exist
(
PeerModule
)
;
}
)
;
it
(
'should be able to create class'
,
function
(
)
{
Peer
=
PeerModule
;
should
.
exist
(
Peer
)
;
}
)
;
it
(
'should be able to create instance'
,
function
(
)
{
var
p
=
new
Peer
(
'localhost'
,
8333
)
;
should
.
exist
(
p
)
;
}
)
;
it
(
'should be able to create instance'
,
function
(
)
{
var
p
=
new
Peer
(
'localhost:8333'
)
;
should
.
exist
(
p
)
;
}
)
;
it
(
'should be able to create instance'
,
function
(
)
{
var
p
=
new
Peer
(
'localhost:8333'
)
;
var
p2
=
new
Peer
(
p
)
;
should
.
exist
(
p2
)
;
}
)
;
it
(
'should not be able to create instance'
,
function
(
)
{
should
.
throw
(
function
(
)
{
new
Peer
(
8333
)
;
}
)
;
}
)
;
it
(
'should be able to create instance'
,
function
(
)
{
var
p
=
new
Peer
(
'localhost'
,
8333
)
;
p
.
toString
(
)
.
should
.
equal
(
'localhost:8333'
)
;
}
)
;
it
(
'check host as buffer'
,
function
(
)
{
var
p
=
new
Peer
(
'127.0.0.1'
,
8333
)
;
p
.
getHostAsBuffer
(
)
.
toString
(
'hex'
)
.
should
.
equal
(
'7f000001'
)
;
}
)
;
}
)
;
Back
|
FazBrowse Home
|
New Git URL