ts-mockito icon indicating copy to clipboard operation
ts-mockito copied to clipboard

How to mock a builder pattern

Open atlanteh opened this issue 3 years ago • 0 comments
trafficstars

let's say I have a builder class as following:

function dbAccess(query) {
  // do some stuff
  query.withPagination(somePagination).withOffset(someOffset).execute()
 // do some other stuff
}

I want to test dbAccess and verify that query was called with specific params. How do I do this?

atlanteh avatar Apr 04 '22 11:04 atlanteh