<commit_before>#!/usr/bin/env node

'use strict';

const assert = require('assert');
const utils = require('../utils.js');

assert(!module.parent);
assert(__dirname === process.cwd());

const target = process.argv[2] || 'host';
const standard = 'stdout';

let right;

const inspect = (standard === 'stdout')
  ? [ 'inherit', 'pipe', 'inherit' ]
  : [ 'inherit', 'inherit', 'pipe' ];

right = utils.pkg.sync([
  '--debug',
  '--target', target,
  '--output', 'no-output', '12345'
], { stdio: inspect, expect: 2 });

assert(right.indexOf('\x1B\x5B') < 0, 'colors detected');

/*
// TODO restore

right = right.split('\n').filter(function (line) {
  return line.indexOf('  error  ') >= 0;
}).map(function (line) {
  return line.split('  error  ')[1];
}).join('\n') + '\n';

assert.equal(right,
  'Cannot read file, ENOENT\n'
);

assert.equal(right,
  'Cannot read file, ENOENT\n'
);
*/
<commit_msg>restored `test-50-nonexistent`<commit_after>#!/usr/bin/env node

'use strict';

const assert = require('assert');
const utils = require('../utils.js');

assert(!module.parent);
assert(__dirname === process.cwd());

const target = process.argv[2] || 'host';
const standard = 'stdout';

let right;

const inspect = (standard === 'stdout')
  ? [ 'inherit', 'pipe', 'inherit' ]
  : [ 'inherit', 'inherit', 'pipe' ];

right = utils.pkg.sync([
  '--debug',
  '--target', target,
  '--output', 'no-output', '12345'
], { stdio: inspect, expect: 2 });

assert(right.indexOf('\x1B\x5B') < 0, 'colors detected');
assert(right.indexOf('Error!') >= 0);
assert(right.indexOf('12345') >= 0);
assert(right.indexOf('not exist') >= 0);

{'fraction_non_alphanumeric': 0.23496590204587725, 'fraction_numerical': 0.019838809671419714, 'mean_word_length': 4.344370860927152, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '3201285', 'n_tokens_mistral': 591, 'n_tokens_neox': 575, 'n_words': 133}