<commit_before>// Native
import path from 'path';

// Packages
import test from 'ava';
import {Application} from 'spectron';

let app;

test.before(async () => {
  app = new Application({
    path: path.join(__dirname, '../dist/mac/HyperTerm.app/Contents/MacOS/HyperTerm')
  });

  await app.start();<commit_msg>Fix AVA tests on Linux (#735)<commit_after>// Native
import path from 'path';

// Packages
import test from 'ava';
import {Application} from 'spectron';

let app;

test.before(async () => {
  let pathToBinary;

  switch (process.platform) {
    case 'linux':
      pathToBinary = path.join(__dirname, '../dist/linux-unpacked/HyperTerm');
      break;

    case 'darwin':
      pathToBinary = path.join(__dirname, '../dist/mac/HyperTerm.app/Contents/MacOS/HyperTerm');
      break;

    default:
      throw new Error('Path to the built binary needs to be defined for this platform in test/index.js');
  }

  app = new Application({
    path: pathToBinary
  });

  await app.start();
{'fraction_non_alphanumeric': 0.14587525150905434, 'fraction_numerical': 0.0030181086519114686, 'mean_word_length': 3.4026548672566372, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2074525', 'n_tokens_mistral': 322, 'n_tokens_neox': 308, 'n_words': 88}