miniredis icon indicating copy to clipboard operation
miniredis copied to clipboard

not support mock err

Open javacode123 opened this issue 2 years ago • 1 comments

when i write unit test, i need to write case with redis command return err. So how can i use miniredis return err with specify parameters

javacode123 avatar Jun 21 '23 07:06 javacode123

Maybe this method helps?

// make every command return this message. For example:
//
//  LOADING Redis is loading the dataset in memory
//  MASTERDOWN Link with MASTER is down and replica-serve-stale-data is set to 'no'.
//
// Clear it with an empty string. Don't add newlines.
func (m *Miniredis) SetError(msg string)

alicebob avatar Jun 21 '23 08:06 alicebob