sinonSandbox
.stub(LobService, 'createPostcard')
.callsFake(() => {
const postcard = new Postcard({ id: `psc_${faker.random.alphaNumeric(16)}` });
return Promise.resolve(postcard);
});
Everytime the function createPostcard
is called, which is mocked btw, the function is called a new postcard is made.
Top comments (0)