File tree Expand file tree Collapse file tree 3 files changed +20
-7
lines changed
bruno-app/src/components/RequestPane/Assertions Expand file tree Collapse file tree 3 files changed +20
-7
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ import lightTheme from 'themes/light';
32
32
* isNumber : is number
33
33
* isString : is string
34
34
* isBoolean : is boolean
35
+ * isArray : is array
35
36
*/
36
37
37
38
const AssertionOperator = ( { operator, onChange } ) => {
@@ -61,7 +62,8 @@ const AssertionOperator = ({ operator, onChange }) => {
61
62
'isJson' ,
62
63
'isNumber' ,
63
64
'isString' ,
64
- 'isBoolean'
65
+ 'isBoolean' ,
66
+ 'isArray'
65
67
] ;
66
68
67
69
const handleChange = ( e ) => {
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ import { useTheme } from 'providers/Theme';
33
33
* isNumber : is number
34
34
* isString : is string
35
35
* isBoolean : is boolean
36
+ * isArray : is array
36
37
*/
37
38
const parseAssertionOperator = ( str = '' ) => {
38
39
if ( ! str || typeof str !== 'string' || ! str . length ) {
@@ -68,7 +69,8 @@ const parseAssertionOperator = (str = '') => {
68
69
'isJson' ,
69
70
'isNumber' ,
70
71
'isString' ,
71
- 'isBoolean'
72
+ 'isBoolean' ,
73
+ 'isArray'
72
74
] ;
73
75
74
76
const unaryOperators = [
@@ -81,7 +83,8 @@ const parseAssertionOperator = (str = '') => {
81
83
'isJson' ,
82
84
'isNumber' ,
83
85
'isString' ,
84
- 'isBoolean'
86
+ 'isBoolean' ,
87
+ 'isArray'
85
88
] ;
86
89
87
90
const [ operator , ...rest ] = str . trim ( ) . split ( ' ' ) ;
@@ -118,7 +121,8 @@ const isUnaryOperator = (operator) => {
118
121
'isJson' ,
119
122
'isNumber' ,
120
123
'isString' ,
121
- 'isBoolean'
124
+ 'isBoolean' ,
125
+ 'isArray'
122
126
] ;
123
127
124
128
return unaryOperators . includes ( operator ) ;
Original file line number Diff line number Diff line change @@ -66,6 +66,7 @@ chai.use(function (chai, utils) {
66
66
* isNumber : is number
67
67
* isString : is string
68
68
* isBoolean : is boolean
69
+ * isArray : is array
69
70
*/
70
71
const parseAssertionOperator = ( str = '' ) => {
71
72
if ( ! str || typeof str !== 'string' || ! str . length ) {
@@ -101,7 +102,8 @@ const parseAssertionOperator = (str = '') => {
101
102
'isJson' ,
102
103
'isNumber' ,
103
104
'isString' ,
104
- 'isBoolean'
105
+ 'isBoolean' ,
106
+ 'isArray'
105
107
] ;
106
108
107
109
const unaryOperators = [
@@ -114,7 +116,8 @@ const parseAssertionOperator = (str = '') => {
114
116
'isJson' ,
115
117
'isNumber' ,
116
118
'isString' ,
117
- 'isBoolean'
119
+ 'isBoolean' ,
120
+ 'isArray'
118
121
] ;
119
122
120
123
const [ operator , ...rest ] = str . trim ( ) . split ( ' ' ) ;
@@ -151,7 +154,8 @@ const isUnaryOperator = (operator) => {
151
154
'isJson' ,
152
155
'isNumber' ,
153
156
'isString' ,
154
- 'isBoolean'
157
+ 'isBoolean' ,
158
+ 'isArray'
155
159
] ;
156
160
157
161
return unaryOperators . includes ( operator ) ;
@@ -313,6 +317,9 @@ class AssertRuntime {
313
317
case 'isBoolean' :
314
318
expect ( lhs ) . to . be . a ( 'boolean' ) ;
315
319
break ;
320
+ case 'isArray' :
321
+ expect ( lhs ) . to . be . a ( 'array' ) ;
322
+ break ;
316
323
default :
317
324
expect ( lhs ) . to . equal ( rhs ) ;
318
325
break ;
You can’t perform that action at this time.
0 commit comments