fix issue 392- corrected promise scheduling with chaining
This commit is contained in:
parent
98611f4d76
commit
487ed8c47b
|
@ -163,11 +163,11 @@ describe('fs.rename', function() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Promise.all(
|
|
||||||
fs.promises.open('/myfile', 'w+')
|
fs.promises.open('/myfile', 'w+')
|
||||||
.then((fd)=>fs.promises.close(fd)),
|
.then((fd)=>fs.promises.close(fd))
|
||||||
fs.promises.rename('/myfile', '/myotherfile'),
|
.then(fs.promises.rename('/myfile', '/myotherfile'))
|
||||||
fs.promises.stat('/myfile')
|
.then(Promise.all(fs.promises.stat('/myfile')
|
||||||
.then( (result)=> expect(result).not.to.exist, (error) => expect(error).to.exist)
|
.then( (result)=> expect(result).not.to.exist, (error) => expect(error).to.exist)
|
||||||
.finally(()=>{
|
.finally(()=>{
|
||||||
complete1 = true;
|
complete1 = true;
|
||||||
|
@ -178,7 +178,8 @@ describe('fs.rename', function() {
|
||||||
.finally(()=>{
|
.finally(()=>{
|
||||||
complete2 = true;
|
complete2 = true;
|
||||||
maybeDone();
|
maybeDone();
|
||||||
})
|
})))
|
||||||
).catch((error)=> {throw error;});
|
|
||||||
|
.catch((error)=> {throw error;});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue