mirror of
https://github.com/all-contributors/cli.git
synced 2025-01-09 13:36:29 +00:00
refactor: return a Promise instead of relying on callback parameter (#289)
This commit is contained in:
parent
f1d576fda7
commit
d44b70a1f0
1 changed files with 16 additions and 12 deletions
|
@ -30,14 +30,17 @@ test('create contributors section if content is empty', () => {
|
|||
expect(result).toMatchSnapshot()
|
||||
})
|
||||
|
||||
test('README exists', 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 => {
|
||||
test("LOREM doesn't exists", () => {
|
||||
return new Promise(done => {
|
||||
const file = 'LOREM.md'
|
||||
ensureFileExists(file).then(data => {
|
||||
expect(data).toStrictEqual(file)
|
||||
|
@ -47,3 +50,4 @@ test("LOREM doesn't exists", done => {
|
|||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue