BenoƮt
02/25/2022, 8:56 AMcontainerHost.assert( initialState ) {
states({ dataFromCache }) // first state
refreshCache() // update cache
states({ updatedDataFromCache }). // updated state emitted AFTER cache update
}
For some reason the 1st option fails fails, but if I run the following it passes:
refreshCache()
containerHost.assert( initialState ) {
states({ dataFromCache }, { updatedDataFromCache })
}
However, the 2nd option doesn't guarantee that the second state was only emitted after the refreshCache()
function was called. It feels like there's no way to assert the timing at which new states are emitted using the states
function.
Any idea?appmattus
02/25/2022, 9:08 AMappmattus
02/25/2022, 9:10 AMassert
really just waits for the required number of states right each time
containerHost.assert( initialState ) {
states({ dataFromCache }) // first state
}
refreshCache() // update cache
containerHost.assert( initialState ) {
states({ dataFromCache }) // first state
states({ updatedDataFromCache }). // updated state emitted AFTER cache update
}
BenoƮt
02/25/2022, 9:13 AMMikolaj Leszczynski
02/25/2022, 9:27 AM