dashersw / cote

A Node.js library for building zero-configuration microservices.

Home Page:http://cote.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

infrequent error thrown {matcherResult: {pass: false }}

eitzenbe opened this issue · comments

When running jest tests some tests fail infrequently with an error thrown while sending an request to a microservice:

{"matcherResult":{"pass":false}}

The exception is caught inside the loginNperform method that has the => method in a try catch block.

Google didnt return any hit on the property so I am blocked and dont know whether this is at all a cote issue or jest related (I doubt).

So any kind soul that could tell me whether this is related to cote at all?

Funny thing is that ignoring the exception in the test code still yields success in the test run (and some tests depend on successful completion of óthers)

The exemplaric code is:

test('POS get license for game', done => {
      loginNperform(accountsvcCli, adminCredentials, done, async (authreq) => {
        authreq.type = 'get-game-licenses';
        const startdate = new Date();
        const enddate = new Date(new Date().setFullYear(startdate.getFullYear() + 1));
        authreq.params = {
          id: 3
        };
        gamesvcCli.send(authreq, (result) => {
          try {
            expect(result.error).toBeNull();
            expect(result.licenses).toHaveLength(1);
            expect(result.licenses[0].licenseStart).toBe(startdate.toISOString().slice(0, 10));
            expect(result.licenses[0].licenseEnd).toBe(enddate.toISOString().slice(0, 10));
            done();
          } catch (error) {
            done(error);
          }
        });
      });
    });

Closed as tis JEST related (sorry for confusion)