()
| 50 | } |
| 51 | |
| 52 | async function main () { |
| 53 | if (VERSION === '0.0.0') { |
| 54 | throw new Error('VERSION not set!') |
| 55 | } |
| 56 | |
| 57 | const botList = getBotList() |
| 58 | try { |
| 59 | await Promise.all( |
| 60 | botList.map(bot => bot.start()), |
| 61 | ) |
| 62 | for (const bot of botList) { |
| 63 | console.info(`Wechaty v${bot.version()} smoking test passed.`) |
| 64 | console.info('listenerCount(message) is', bot.listenerCount('message')) |
| 65 | } |
| 66 | } catch (e) { |
| 67 | console.error(e) |
| 68 | // Error! |
| 69 | return 1 |
| 70 | } finally { |
| 71 | await Promise.all( |
| 72 | botList.map(bot => bot.stop()), |
| 73 | ) |
| 74 | } |
| 75 | return 0 |
| 76 | } |
| 77 | |
| 78 | main() |
| 79 | .then(process.exit) |
no test coverage detected
searching dependent graphs…