vendredi 26 février 2016

Ensure the done() callback is being called in this test (Mocha, Chai, Sinon)

Looking at other questions, can't really find the cause of the problem. I am trying to import a module and test it using mocha.

import chai, {
    expect
}
from 'chai';
import sinon from 'sinon';
import sinonChai from 'sinon-chai';
import System from 'systemjs';
import '../public/config.js';

chai.use(sinonChai);

describe('helperModule', () => {
    let module;

    before(function () {
        return System.import('./public/js/helper.js')
            .then((mod) => module = mod);
    });

    describe('Module loading', function () {
        it('should load', function(){
            expect(module.default).to.not.be.undefined;
        });
    });
});

I get the following error when running the npm test command.

1) helperModule "before all" hook:
     Error: timeout of 2000ms exceeded. Ensure the done() callback is being
 called in this test.

Not really sure where to put the done callback. If you need any extra information about any packages I am using I will edit my question with them.

Aucun commentaire:

Enregistrer un commentaire