lib/format/markdown.js
function transformSuite(name, suite, depth, indentCodeBlocks) {
  const children = suite.children;
  const snapshots = suite.snapshots;
  const nextDepth = depth + 1;

  let result = suiteHeader(name, depth);
  let keys, i;

  keys = Object.keys(snapshots);
  for (i = 0; i < keys.length; i++) {
    const key = keys[i];
    const snapshotList = snapshots[key];
    result += transformSnapshotList(key, snapshotList, nextDepth, indentCodeBlocks);
  }

  keys = Object.keys(children);
  for (i = 0; i < keys.length; i++) {
    const key = keys[i];
    result += transformSuite(key, children[key], nextDepth, indentCodeBlocks);
  }
  return result;
}
function transformSuite(name, suite, depth, indentCodeBlocks) {
  const children = suite.children;
  const snapshots = suite.snapshots;
  const nextDepth = depth + 1;

  let result = suiteHeader(name, depth);
  let keys, i;

  keys = Object.keys(snapshots);
  for (i = 0; i < keys.length; i++) {
    const key = keys[i];
    const snapshotList = snapshots[key];
    result += transformSnapshotList(key, snapshotList, nextDepth, indentCodeBlocks);
  }

  keys = Object.keys(children);
  for (i = 0; i < keys.length; i++) {
    const key = keys[i];
    result += transformSuite(key, children[key], nextDepth, indentCodeBlocks);
  }
  return result;
}
transformSuite converts suite from native into markdown format.

@param {string} name Suite name.
@param {*} suite Suite.
@param {number} depth Suite depth.
@param {boolean} indentCodeBlocks  Use indentation for code blocks.
@returns Suite in a markdown format.