<commit_before>var Application = require('spectron').Application;
global.assert = require('../tests/assert_extras');

function sleep (ms) {
    return new Promise(resolve => setTimeout(resolve, ms));
}

describe('application launch', function () {
  this.timeout(10000)

  var app, client;

  before(() => {
    app = new Application({
      path: './node_modules/.bin/electron',
      args: ['main.js', 'postgres://localhost/integration_test'],
      env: {NW_DEV: "true"}
    })

    return app.start().then((result) => {
      client = app.client;
      app.client.getMainProcessLogs().then(logs => {
        logs.forEach(log => {
          console.log(log)
        })
      })
<commit_msg>Connect to other port in tests<commit_after>var Application = require('spectron').Application;
global.assert = require('../tests/assert_extras');

function sleep (ms) {
    return new Promise(resolve => setTimeout(resolve, ms));
}

describe('application launch', function () {
  this.timeout(10000)

  var app, client;

  before(() => {
    app = new Application({
      path: './node_modules/.bin/electron',
      args: ['main.js', `postgres://localhost:${process.env.PG_PORT || '5432'}/integration_test`],
      env: {NW_DEV: "true"}
    })

    return app.start().then((result) => {
      client = app.client;
      app.client.getMainProcessLogs().then(logs => {
        logs.forEach(log => {
          console.log(log)
        })
      })

{'fraction_non_alphanumeric': 0.17270194986072424, 'fraction_numerical': 0.009749303621169917, 'mean_word_length': 3.059322033898305, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '5878092', 'n_tokens_mistral': 453, 'n_tokens_neox': 430, 'n_words': 84}