Mocha: AssertionError: expected promise to be fulfilled but it was rejected with IError{ …(3) }

Viewed 38

i'm having problems in executing tests with mocha. Whenever I try, I get the error message AssertionError: expected promise to be fulfilled but it was rejected with IError{ …(3) } The problem is that this error is shown only to me (Ubuntu user). Other people that are using Windows don't have this error message. The code is the following:

it("should fulfil", () => {
 return expect(handler(mockedRequest, mockedResponse)).to.eventually.be.fulfilled
})

If I try to exclude this test, the error will appear again with other similar tests. The script that runs test is the following:

export NODE_CONFIG_DIR=./src/config && npx mocha --timeout 20000 -r ts-node/register 'test/**/*.test.ts'
0 Answers
Related