Yeoman testing times out anywhere but locally

78 Views Asked by At

I have some testing with the following structure:

describe('yeoman:subyeoman', function () {
   before(function (done) {
       helpers.run(path)
           .inTmpDir(function (dir) {
               ** some file copying **
           })
           .withOptions({
               'option': options
           })
           .withArguments(argumentsJson)
           .on('ready', function (generator) {
               generator.conflicter.force = true;

               var html = "some html";
               var dir = generator.destinationPath('app');
               var file = generator.destinationPath('app/file.html');

               if (!fs.existsSync(dir)) fs.mkDir(dir);
               fs.writeFile(file, html);
           })
           .on('end', function () {
               fse.removeSync(somePath);
               done();
           });
   });

   it('.....');
});

The on('ready') piece does its work both locally and inside the docker container, but inside the container never calls generator.run() and throws the following error:

Error: timeout of 20000ms exceeded. Ensure the done() callback is being called in this test.

I've tried changing the timeout and doing it the async way but the output its still the same.

Any help will be appreciated .

1

There are 1 best solutions below

0
TechnoTim On

This seems to happen if you have an error in your code that doesn't bubble up with testing. Check any manipulation to the this context especially.