diff --git a/src/init/__tests__/add-contributors-list.js b/src/init/__tests__/add-contributors-list.js index cb690ce..bb53233 100644 --- a/src/init/__tests__/add-contributors-list.js +++ b/src/init/__tests__/add-contributors-list.js @@ -30,20 +30,24 @@ test('create contributors section if content is empty', () => { expect(result).toMatchSnapshot() }) -test('README exists', done => { - const file = 'README.md' - ensureFileExists(file) - .then(data => expect(data).toStrictEqual(file)) - .then(_ => done()) +test('README exists', () => { + return new Promise(done => { + const file = 'README.md' + ensureFileExists(file) + .then(data => expect(data).toStrictEqual(file)) + .then(_ => done()) + }) }) -test("LOREM doesn't exists", done => { - const file = 'LOREM.md' - ensureFileExists(file).then(data => { - expect(data).toStrictEqual(file) - return unlink(file, err => { - if (err) throw err - done() +test("LOREM doesn't exists", () => { + return new Promise(done => { + const file = 'LOREM.md' + ensureFileExists(file).then(data => { + expect(data).toStrictEqual(file) + return unlink(file, err => { + if (err) throw err + done() + }) }) }) })