<commit_before>'use strict'

const ozy = require('./')
const db = require('./db/instance')
const tape = require('tape')
const Client = require('test-client')

module.exports = (name, test) => tape(name, async (t) => {
  const app = t.app = ozy()

  for (const route of require('./session')) app.use(route)

  // Default client.
  app.context.client = () => null

  // Set up transactions.
  const transaction = db.transaction()
  db.query = transaction.query.bind(transaction)

  const client = new Client(app)

  try {
    await test(t, {app, client})
    t.end()
  } catch (error) {
    t.end(error)
  } finally {
    transaction.rollback()
  }
})
<commit_msg>t -> assert<commit_after>'use strict'

const ozy = require('./')
const db = require('./db/instance')
const tape = require('tape')
const Client = require('test-client')

module.exports = (name, test) => tape(name, async (assert) => {
  const app = assert.app = ozy()

  for (const route of require('./session')) app.use(route)

  // Default client.
  app.context.client = () => null

  // Set up transactions.
  const transaction = db.transaction()
  db.query = transaction.query.bind(transaction)

  const client = new Client(app)

  try {
    await test(assert, {app, client})
    assert.end()
  } catch (error) {
    assert.end(error)
  } finally {
    transaction.rollback()
  }
})

{'fraction_non_alphanumeric': 0.16778025241276912, 'fraction_numerical': 0.0, 'mean_word_length': 3.2929936305732483, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1603490', 'n_tokens_mistral': 439, 'n_tokens_neox': 430, 'n_words': 115}