Muthu Kumar
6 years ago
2 changed files with 8 additions and 7 deletions
@ -1,11 +1,12 @@ |
|||
'use strict'; |
|||
|
|||
const { pass, fail } = require('../constants'); |
|||
const { pass, fail } = require('./constants'); |
|||
|
|||
const runTests = tests => Promise.all(tests.map(test => |
|||
test.test() |
|||
.then(() => ({ description: test.description, result: pass })) |
|||
.catch(e => ({ description: test.description, result: fail, error: e })) |
|||
)); |
|||
const runTests = tests => Promise.all(tests.map(each => { |
|||
const pred = each.test(); |
|||
return (Array.isArray(pred) ? Promise.all(pred) : pred) |
|||
.then(() => ({ description: each.description, result: pass })) |
|||
.catch(e => ({ description: each.description, result: fail, error: e })); |
|||
})); |
|||
|
|||
module.exports = runTests; |
|||
|
Loading…
Reference in new issue