FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
node/test/parallel/test-benchmark-cli.js at main · fetchapi/node · GitHub
fetchapi
/
node
Public
forked from
nodejs/node
Notifications
You must be signed in to change notification settings
Fork
1
Star
0
Code
Pull requests
1
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
node
/
test
/
parallel
/
test-benchmark-cli.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
38 lines (25 loc) · 1.18 KB
Breadcrumbs
node
/
test
/
parallel
/
test-benchmark-cli.js
Copy path
File metadata and controls
38 lines (25 loc) · 1.18 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
'use strict'
;
require
(
'../common'
)
;
// This tests the CLI parser for our benchmark suite.
const
assert
=
require
(
'assert'
)
;
const
CLI
=
require
(
'../../benchmark/_cli.js'
)
;
const
originalArgv
=
process
.
argv
;
function
testFilterPattern
(
filters
,
excludes
,
filename
,
expectedResult
)
{
process
.
argv
=
process
.
argv
.
concat
(
...
filters
.
map
(
(
p
)
=>
[
'--filter'
,
p
]
)
)
;
process
.
argv
=
process
.
argv
.
concat
(
...
excludes
.
map
(
(
p
)
=>
[
'--exclude'
,
p
]
)
)
;
process
.
argv
=
process
.
argv
.
concat
(
[
'bench'
]
)
;
const
cli
=
new
CLI
(
''
,
{
'arrayArgs'
:
[
'filter'
,
'exclude'
]
}
)
;
assert
.
deepStrictEqual
(
cli
.
shouldSkip
(
filename
)
,
expectedResult
)
;
process
.
argv
=
originalArgv
;
}
testFilterPattern
(
[
]
,
[
]
,
'foo'
,
false
)
;
testFilterPattern
(
[
'foo'
]
,
[
]
,
'foo'
,
false
)
;
testFilterPattern
(
[
'foo'
]
,
[
]
,
'bar'
,
true
)
;
testFilterPattern
(
[
'foo'
,
'bar'
]
,
[
]
,
'foo'
,
false
)
;
testFilterPattern
(
[
'foo'
,
'bar'
]
,
[
]
,
'bar'
,
false
)
;
testFilterPattern
(
[
]
,
[
'foo'
]
,
'foo'
,
true
)
;
testFilterPattern
(
[
]
,
[
'foo'
]
,
'bar'
,
false
)
;
testFilterPattern
(
[
]
,
[
'foo'
,
'bar'
]
,
'foo'
,
true
)
;
testFilterPattern
(
[
]
,
[
'foo'
,
'bar'
]
,
'bar'
,
true
)
;
testFilterPattern
(
[
'foo'
]
,
[
'bar'
]
,
'foo'
,
false
)
;
testFilterPattern
(
[
'foo'
]
,
[
'bar'
]
,
'foo-bar'
,
true
)
;
Back
|
FazBrowse Home
|
New Git URL