I'm trying my hand at writing unit tests with mocha and chai, however I'm running into an issue where I'm getting timeout errors instead of actual errors being thrown and I can't seem to find a workaround.
Error I'm getting:
1) Unit Tests for Networks Array
should check that networks array is not empty:
Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.
In my code I've made it that the opposite of what I'm testing for is true, so I have an expected failure.
Is there a standard way of fixing this sort of thing?
describe('Unit Tests for Networks Array\n', function () {
it('should check that networks array is not empty', function (done) {
git.getNetworks(function (networks) {
expect(networks).to.be.empty(); // expected failure
done();
});
});