async function testInsideTransaction({ plan, agent, testFunc }) {
  helper.runInTransaction(agent, (tx) => {
    const name = '[in tx]'
    plan.doesNotThrow(() => {
      let isAsync = false
      testFunc(name)
        .finally(() => plan.ok(isAsync, `${name} should have executed asynchronously`))
        .then(
          function resolved() {
            plan.equal(agent.getTransaction(), tx, `${name} has the right transaction`)
          },
          function rejected(error) {
            plan.ok(!error, `${name} should not result in error`)
          }
        )
      isAsync = true
    })
  })
}
Tests a `when` library method inside of an agent transaction.

@param {object} params
@param params.plan
@param {object} plan The assertion library that expects a set number of
assertions to be completed during the test.
@param {object} agent A mocked agent instance.
@param {function} testFunc A function that accepts a "name" parameter and
returns a promise. The parameter is a string for identifying the test and
values used within the test.
@param params.agent
@param params.testFunc
@returns {Promise<void>}