private getErrorMessage()

in test-reporter/src/parsers/dart-json/dart-json-parser.ts [194:207]


  private getErrorMessage(message: string, print: string): string {
    if (this.sdk === 'flutter') {
      const uselessMessageRe = /^Test failed\. See exception logs above\.\nThe test description was:/m
      const flutterPrintRe = /^══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞═+\s+(.*)\s+When the exception was thrown, this was the stack:/ms
      if (uselessMessageRe.test(message)) {
        const match = print.match(flutterPrintRe)
        if (match !== null) {
          return match[1]
        }
      }
    }

    return message || print
  }