FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
json-rules-engine/test/operator.test.js at master · CacheControl/json-rules-engine · GitHub
CacheControl
/
json-rules-engine
Public
Notifications
You must be signed in to change notification settings
Fork
507
Star
3.1k
Code
Issues
61
Pull requests
7
Discussions
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
json-rules-engine
/
test
/
operator.test.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
31 lines (26 loc) · 758 Bytes
Breadcrumbs
json-rules-engine
/
test
/
operator.test.js
Copy path
File metadata and controls
31 lines (26 loc) · 758 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
'use strict'
import
{
Operator
}
from
'../src/index'
describe
(
'Operator'
,
(
)
=>
{
describe
(
'constructor()'
,
(
)
=>
{
function
subject
(
...
args
)
{
return
new
Operator
(
...
args
)
}
it
(
'adds the operator'
,
(
)
=>
{
const
operator
=
subject
(
'startsWithLetter'
,
(
factValue
,
jsonValue
)
=>
{
return
factValue
[
0
]
===
jsonValue
}
)
expect
(
operator
.
name
)
.
to
.
equal
(
'startsWithLetter'
)
expect
(
operator
.
cb
)
.
to
.
an
.
instanceof
(
Function
)
}
)
it
(
'operator name'
,
(
)
=>
{
expect
(
(
)
=>
{
subject
(
)
}
)
.
to
.
throw
(
/
M
i
s
s
i
n
g
o
p
e
r
a
t
o
r
n
a
m
e
/
)
}
)
it
(
'operator definition'
,
(
)
=>
{
expect
(
(
)
=>
{
subject
(
'startsWithLetter'
)
}
)
.
to
.
throw
(
/
M
i
s
s
i
n
g
o
p
e
r
a
t
o
r
c
a
l
l
b
a
c
k
/
)
}
)
}
)
}
)
Back
|
FazBrowse Home
|
New Git URL