()
| 60 | } |
| 61 | |
| 62 | const done = () => { |
| 63 | event.emit(event.all.result, container.result()) |
| 64 | event.emit(event.all.after, this) |
| 65 | |
| 66 | // Check if there were any failures |
| 67 | if (container.result().hasFailed) { |
| 68 | reject(new Error('Test run failed')) |
| 69 | } else { |
| 70 | resolve(undefined) |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | event.emit(event.all.before, this) |
| 75 | mocha.run(() => done()) |