skovhus / jest-codemods

Codemods for migrating to Jest https://github.com/facebook/jest 👾
MIT License
879 stars 82 forks source link

Mocha: done to promise transform #33

Open Vanuan opened 7 years ago

Vanuan commented 7 years ago

In mocha it is possible to write this:

beforeAll((done) => {
  done();
});

Jasmine requires a promise to be returned. Is it possible to rewrite this to the following:

beforeAll(() => {
  let promise = new Promise((resolve, reject) => {
    resolve();
  });
  return promise;
});
skovhus commented 7 years ago

Thanks for reporting this! Feel free to submit a pull request, maybe you want to give it a try? : )

Vanuan commented 7 years ago

No, I'll use manual labor for now