File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
import commander from '../src/cli/utils/commander' ;
3
3
import definitions from '../src/cli/definitions/parse-server' ;
4
+ import liveQueryDefinitions from '../src/cli/definitions/parse-live-query-server' ;
4
5
5
6
var testDefinitions = {
6
7
'arg0' : 'PROGRAM_ARG_0' ,
@@ -143,7 +144,26 @@ describe('definitions', () => {
143
144
for ( let key in definitions ) {
144
145
let definition = definitions [ key ] ;
145
146
expect ( typeof definition ) . toBe ( 'object' ) ;
147
+ if ( typeof definition . env !== 'undefined' ) {
148
+ expect ( typeof definition . env ) . toBe ( 'string' ) ;
149
+ }
150
+ expect ( typeof definition . help ) . toBe ( 'string' ) ;
146
151
if ( typeof definition . required !== 'undefined' ) {
152
+ expect ( typeof definition . required ) . toBe ( 'boolean' ) ;
153
+ }
154
+ if ( typeof definition . action !== 'undefined' ) {
155
+ expect ( typeof definition . action ) . toBe ( 'function' ) ;
156
+ }
157
+ }
158
+ } ) ;
159
+ } ) ;
160
+
161
+ describe ( 'LiveQuery definitions' , ( ) => {
162
+ it ( 'should have valid types' , ( ) => {
163
+ for ( let key in liveQueryDefinitions ) {
164
+ let definition = liveQueryDefinitions [ key ] ;
165
+ expect ( typeof definition ) . toBe ( 'object' ) ;
166
+ if ( typeof definition . env !== 'undefined' ) {
147
167
expect ( typeof definition . env ) . toBe ( 'string' ) ;
148
168
}
149
169
expect ( typeof definition . help ) . toBe ( 'string' ) ;
You can’t perform that action at this time.
0 commit comments