<commit_before>const z1 = require('..')
const { once } = require('better-events')
const { spawn } = require('child_process')
let daemon

before(async function () {
  // wait for the test-daemon to start

  this.timeout(10000)
  daemon = spawn('istanbul', ['cover', './daemon/main.js', '--dir', './coverage/daemon'], {
    stdio: 'inherit'
  })

  const connection = z1._waitForConnection()
  const error = once(daemon, 'error')

  await Promise.race([connection, error])
})

after(async function () {
  // wait for daemon to stop

  this.timeout(10000)

  z1.exit()

  await once(daemon, 'exit')
})

describe('z1', function () {
  describe('command', function () {
    this.timeout(15000)

    beforeEach(function () {
      this.apps = []
    })

    afterEach(async function () {
      for (let i = 0; i < this.apps.length; i += 1) {
        await z1.stop(this.apps[i])
      }<commit_msg>increase test timeout<commit_after>const z1 = require('..')
const { once } = require('better-events')
const { spawn } = require('child_process')
let daemon

const TIMEOUT = 30000 // 30s

before(async function () {
  // wait for the test-daemon to start

  this.timeout(TIMEOUT)
  daemon = spawn('istanbul', ['cover', './daemon/main.js', '--dir', './coverage/daemon'], {
    stdio: 'inherit'
  })

  const connection = z1._waitForConnection()
  const error = once(daemon, 'error')

  await Promise.race([connection, error])
})

after(async function () {
  // wait for daemon to stop

  this.timeout(TIMEOUT)

  z1.exit()

  await once(daemon, 'exit')
})

describe('z1', function () {
  describe('command', function () {
    this.timeout(TIMEOUT)

    beforeEach(function () {
      this.apps = []
    })

    afterEach(async function () {
      for (let i = 0; i < this.apps.length; i += 1) {
        await z1.stop(this.apps[i])
      }
{'fraction_non_alphanumeric': 0.1714129244249726, 'fraction_numerical': 0.019715224534501644, 'mean_word_length': 3.171232876712329, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '4066287', 'n_tokens_mistral': 644, 'n_tokens_neox': 605, 'n_words': 144}