Support err as first argument for done callbacks in async tests
This commit is contained in:
parent
9b5afff52e
commit
fad8a7286b
2 changed files with 16 additions and 12 deletions
|
|
@ -153,10 +153,14 @@ o.spec("ospec", function() {
|
|||
var a = 0, b = 0
|
||||
|
||||
function wrapPromise(fn) {
|
||||
return new Promise(resolve => {
|
||||
return new Promise((resolve, reject) => {
|
||||
callAsync(() => {
|
||||
fn()
|
||||
resolve()
|
||||
try {
|
||||
fn()
|
||||
resolve()
|
||||
} catch(e) {
|
||||
reject(e)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue