I am attempting to run a fail case test for this TypeScript function using Sinon, however, I am unsure how to proceed. Can anyone provide assistance?
public async findById(id: number): Promise<UserModel> {
const user = await this._userModel.findByPk(id);
if (!user) throw new NotFound('User not found');
return user;
}