FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
debug/test.node.js at master · debug-js/debug · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
debug-js
/
debug
Public
Notifications
You must be signed in to change notification settings
Fork
987
Star
11.5k
Code
Issues
60
Pull requests
35
Actions
Security and quality
1
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
debug
/
test.node.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
40 lines (36 loc) · 1.11 KB
Breadcrumbs
debug
/
test.node.js
Copy path
File metadata and controls
40 lines (36 loc) · 1.11 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
/* eslint-env mocha */
const
assert
=
require
(
'assert'
)
;
const
util
=
require
(
'util'
)
;
const
sinon
=
require
(
'sinon'
)
;
const
debug
=
require
(
'./src/node'
)
;
const
formatWithOptionsSpy
=
sinon
.
spy
(
util
,
'formatWithOptions'
)
;
beforeEach
(
(
)
=>
{
formatWithOptionsSpy
.
resetHistory
(
)
;
}
)
;
describe
(
'debug node'
,
(
)
=>
{
describe
(
'formatting options'
,
(
)
=>
{
it
(
'calls util.formatWithOptions'
,
(
)
=>
{
debug
.
enable
(
'*'
)
;
const
stdErrWriteStub
=
sinon
.
stub
(
process
.
stderr
,
'write'
)
;
const
log
=
debug
(
'formatting options'
)
;
log
(
'hello world'
)
;
assert
(
util
.
formatWithOptions
.
callCount
===
1
)
;
stdErrWriteStub
.
restore
(
)
;
}
)
;
it
(
'calls util.formatWithOptions with inspectOpts'
,
(
)
=>
{
debug
.
enable
(
'*'
)
;
const
options
=
{
hideDate
:
true
,
colors
:
true
,
depth
:
10
,
showHidden
:
true
}
;
Object
.
assign
(
debug
.
inspectOpts
,
options
)
;
const
stdErrWriteStub
=
sinon
.
stub
(
process
.
stderr
,
'write'
)
;
const
log
=
debug
(
'format with inspectOpts'
)
;
log
(
'hello world2'
)
;
assert
.
deepStrictEqual
(
util
.
formatWithOptions
.
getCall
(
0
)
.
args
[
0
]
,
options
)
;
stdErrWriteStub
.
restore
(
)
;
}
)
;
}
)
;
}
)
;
Back
|
FazBrowse Home
|
New Git URL