{"size": 788, "ext": "js", "max_stars_repo_path": "functions/template/src/template.test.js", "max_stars_repo_name": "autotrons/starspawn", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "functions/template/src/template.test.js", "max_issues_repo_name": "autotrons/starspawn", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "functions/template/src/template.test.js", "max_forks_repo_name": "autotrons/starspawn", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 20.2051282051, "max_line_length": 80, "alphanum_fraction": 0.5583756345}
const { assertSuccess } = require("@pheasantplucker/failables-node6")
const { template } = require("./template")
const MEGABYTE = Math.pow(2, 20)

describe("template.js", function() {
  this.timeout(540 * 1000)
  it("should pull a batch of tags between two points in the file", async () => {
    const input = {
      start: 1 * MEGABYTE,
      end: 2 * MEGABYTE,
      start_text: "<job>",
      end_text: "</job>"
    }
    const { req, res } = make_req_res(input)
    const result = await template(req, res)
    assertSuccess(result)
  })
})

function make_req_res(attributes) {
  const req = {
    body: {
      attributes
    }
  }
  const res = {
    status: function() {
      return {
        send: () => {}
      }
    },
    send: () => {}
  }
  return {
    req,
    res
  }
}
