File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
spec/contentScript/github Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -177,6 +177,25 @@ describe('A GithubStore', () => {
177
177
expect ( backingData [ key ] <= after ) . toBeTruthy ( ) ;
178
178
} ) ;
179
179
} ) ;
180
+
181
+ it ( 'WHEN storing data THEN that data is primitive or an array' , async ( ) => {
182
+ function isValidDataFormat ( value : any ) : boolean {
183
+ const type = typeof value ;
184
+ const isPrimitive = type === "string" || type === "number" || type === "boolean" ;
185
+ const isArray = Array . isArray ( value ) ;
186
+ return isPrimitive || isArray ;
187
+ }
188
+
189
+ await testStore . mergeIssueToPRs ( {
190
+ 4 : new Set ( [ 1 , 20 ] ) ,
191
+ 12 : new Set ( [ 487 , 360 , 20 ] )
192
+ } ) ;
193
+
194
+ Object . keys ( backingData ) . forEach ( key => {
195
+ const value = backingData [ key ] ;
196
+ expect ( isValidDataFormat ( value ) ) . toBeTruthy ( `but received ${ value } with type ${ typeof value } ` ) ;
197
+ } )
198
+ } ) ;
180
199
} ) ;
181
200
182
201
it ( 'given a PR last update millis in the DB, will get it' , async ( ) => {
You can’t perform that action at this time.
0 commit comments