tx.session.counter || 0) + 1;
  return ctx.session.counter;
};

// Test that it works
run(ctx).alive(async ctx =&gt; {
  await api.get(&#39;/&#39;);
  await api.get(&#39;/&#39;);
  const res = await api.get(&#39;/&#39;);
  expect(res.body).toBe(&#39;3&#39;);
});
</code></pre>
<h2 id="headers">.headers</h2>
<p>Get the headers that were sent with the request:</p>
<pre><code class="language-js">const mid = ctx =&gt; {
  expect(ctx.headers.answer).toBe(42);
};

// Test it
run(mid).get(&#39;/&#39;, { headers: { 