function assertIsAsyncTest(file, test, api) {
  let j = api.jscodeshift;

  assertIsTest(file, test, api);

  let fn = test
    .find(j.CallExpression, {callee: {name: 'it'}})
    .get('arguments', 1).value;

  if (
    (fn.type !== 'FunctionExpression' &&
      fn.type !== 'ArrowFunctionExpression') ||
    !fn.async
  ) {
    throw new Error(
      `Expected an async function at ${file.path}:${fn.loc.start.line}:${fn.loc.start.column}`,
    );
  }
}
Asserts that the given test is an async function declaration.