Ad
  • Custom User Avatar

    Ok. Nice exercice for Christmas. I try to write a test for errors. It should throw an error if the given joke id does not exist.

    it('should throw an error', async (done) => {
      
      Test.expectError('if no joke found for given id', async () => {
        await sayJoke(url, 12101)
      })
      
      done();
    });
    

    This code doesn't work. I think, it get a promise and don't test the method.

    How I can implement it ?