Closed Jerome1337 closed 4 years ago
We previously had a test for rejecting on a string but not an error, I have added a test here that passes through the supported version;
https://github.com/colonyamerican/mock-knex/pull/94/files
That said I think what may be happening here is that in your getUser
method you expect
.catch(() => Boom.badRequest(`Error while finding user "${username}"`));
to rethrow an error when in fact it will return an error. If you change this to;
.catch(() => throw Boom.badRequest(`Error while finding user "${username}"`));
I think your test will pass
This following code doesn't throw any error, I still get the same response I get when I put a
query.response({})
For your information the
getUser
method is the following:The first console log return a classic query object
Did I miss something or this is a real problem?