JavaScript Expected one assertion to be called but received zero assertion calls

I am trying to test a method using Jest... The method should return Promise.reject() .

Here is the code I wrote:

test('testing Invalid Response Type', () => {       
        const client = new DataClient();

        client.getSomeData().then(response => {
            console.log("We got data: "+ response);
        }).catch(e => {
            console.log("in catch");
            expect(e).toBeInstanceOf(IncorrectResponseTypeError);

        });
        expect.assertions(1);

  });

When I run the test, it prints "in catch" but fails with this exception: Expected one assertion to be called but received zero assertion calls.

console.log src/data/dataclient.test.js:25
      in catch

  ‚óŹ testing Invalid Response Type

    expect.assertions(1)

    Expected one assertion to be called but received zero assertion calls.

      at extractExpectedAssertionsErrors (node_modules/expect/build/extract_expected_assertions_errors.js:37:19)
          at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:188:7)
Answer:1

What I would like to do is calculate the value of a coordinate in the pascal triangle, I got a table with X and Y axis where I have my pascal triangle aligned at the top and the left, what I'm trying ...

What I would like to do is calculate the value of a coordinate in the pascal triangle, I got a table with X and Y axis where I have my pascal triangle aligned at the top and the left, what I'm trying ...

I've given some thoughts on declaring a variable called undefined and evaluating a truthy if-else expression with it. I found out that it is not possible in global scope. But in MDN I've found some ...

I've given some thoughts on declaring a variable called undefined and evaluating a truthy if-else expression with it. I found out that it is not possible in global scope. But in MDN I've found some ...

How i can update value in database using objection ? My SQL query works perfect. UPDATE "freePlace" SET number = number-1 WHERE date >= '2017-10-20' AND date <= '2017-10-30' AND "idObject" ...

How i can update value in database using objection ? My SQL query works perfect. UPDATE "freePlace" SET number = number-1 WHERE date >= '2017-10-20' AND date <= '2017-10-30' AND "idObject" ...

I have a ng-repeat div, and inside the div have select control. This code produces parse error: <select name="qty" ng-model="Qty"> <option ng-repeat="v in [1,2,3,4,5,6,7,8,9,10]" ...

I have a ng-repeat div, and inside the div have select control. This code produces parse error: <select name="qty" ng-model="Qty"> <option ng-repeat="v in [1,2,3,4,5,6,7,8,9,10]" ...