<commit_before>import {childProcess} from 'node-promise-es6';
import {path as phantomJsPath} from 'phantomjs-prebuilt';
import PhantomJS from 'phantomjs-promise-es6';

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

async function phantomPid() {
  try {
    const {stdout: pid} = await childProcess.exec(`pgrep -f '${phantomJsPath}'`);
    return pid.trim();
  } catch (error) {
    return null;
  }
}

describe('phantomjs-promise-es6', () => {
  describe('#exit', () => {
    it('kills the phantomjs process', async () => {
      const browser = new PhantomJS();
      expect(await phantomPid()).not.toBeNull();

      await browser.exit();<commit_msg>Add debug logging for Travis<commit_after>import {childProcess} from 'node-promise-es6';
import {path as phantomJsPath} from 'phantomjs-prebuilt';
import PhantomJS from 'phantomjs-promise-es6';

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

async function phantomPid() {
  try {
    const {stdout: pid} = await childProcess.exec(`pgrep -f '${phantomJsPath}'`);
    return pid.trim();
  } catch (error) {
    return null;
  }
}

describe('phantomjs-promise-es6', () => {
  describe('#exit', () => {
    it('kills the phantomjs process', async () => {
      const browser = new PhantomJS();
      const pid = await phantomPid();
      expect(pid).not.toBeNull();
      process.stdout.write(`${pid}\n`);

      await browser.exit();
{'fraction_non_alphanumeric': 0.1646505376344086, 'fraction_numerical': 0.004032258064516129, 'mean_word_length': 3.8187702265372168, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '6568347', 'n_tokens_mistral': 504, 'n_tokens_neox': 480, 'n_words': 115}