| 37 | |
| 38 | // see comment below for extracting logic into custom consumer later |
| 39 | const formatMessage = (message: string): string => { |
| 40 | // specific for python tap.py output |
| 41 | const isTappy = message.match(/^test_(?<underscoredMessage>.+)\s(?<testPath>.+)$/) |
| 42 | if (isTappy?.groups?.underscoredMessage) { |
| 43 | return isTappy.groups.underscoredMessage.split('_').join(' ').trim() |
| 44 | } |
| 45 | return message.trim() |
| 46 | } |
| 47 | |
| 48 | // TODO: consider creating custom TAP consumers for languages |
| 49 | // otherwise code here will eventually get out of hand |