param { DataStore } datastore param { } assertObj export function registerStoreEvents ( datastore , eventArray , assertObj = { } ) { const eventTypes = [ 'afterLoad' , 'load' , 'loadError' ] ; eventTypes . forEach ( eventType => { datastore . on ( eventType , ( e ) => { eventArray . push ( e . type ) ; if ( Object . keys ( assertObj ) . length ) { assertObj . strictEqual ( e . type , eventType , `Event has correct type: ${ eventType }` ) ; } } ) ; } ) ; } todo param { DataTable } originalTable param { DataTable } exportedTable param { * } assert export function testExportedDataTable ( originalTable , exportedTable , assert ) { assert . strictEqual ( exportedTable . getRowCount ( ) , originalTable . getRowCount ( ) , 'Exported ClassJSON should have the same amount of rows.' ) ; assert . strictEqual ( exportedTable . getColumnNames ( ) . length , originalTable . getColumnNames ( ) . length , 'Exported ClassJSON should have the same amount of cells.' ) ; }