title: JEST Change pre-formatted output from test case
body: <p>I have an application that runs a Jest test suite from the command line, then takes the JSON output, parses it and then fills table in a database as per the output file. The application runs shell command:</p>
  <pre><code>npm run all
  </code></pre>
  <p>and in the package.json file the <code>all</code> script looks like this:</p>
  <pre><code> &quot;scripts&quot;: {
      &quot;all&quot;: &quot;../node_modules/.bin/jest --json --outputFile=testResults.json&quot;,`
      ......
    }
  </code></pre>
  <p>So I get the <code>testResults.json</code> file and I am able to parse it - so far so good.</p>
  <p>But during the test case run I would like to add some extra data to the output. Something like details - where the problems is, how to fix it, some troubleshooting information etc. For example to put one more field in :</p>
  <pre><code>require('testResults.json').testResults[x].assertionResults[y].details
  </code></pre>
  <p>You see, the detail property is not part of the json output file format. But can I create it from within the test case (pseudo example):</p>
  <pre><code>  test('Industry code should match ind_full_code', async () =&gt; {
      result = await stageDb.query(QUERY);
      // And here I want to add this custom information to some global property available?
      reporter.thisTestCase.assertionResults.details = &quot;Here is what you should do to fix this ....&quot; // &lt;- Ideally this is how easy I imagine it to be.
      expect(result.results).toEqual([]);
    }, 2 * 100 * 1000)
  </code></pre>
  <p>I just want to give a little bit more information to the QA or whomever on test failure.</p>
  <p>In other words I need the option to change the output from within the test case.
  I've been looking into custom reporters, but their listeners are passed the same information as to the json reported.</p>