<commit_before>// Currently in sync with Node.js test/pseudo-tty/test-assert-position-indicator.js
// https://github.com/nodejs/node/commit/40a8a7391664e7a5d8a264a1d85d059f9c05063b

'use strict';
require('../common');
const assert = require('../../assert');

process.env.NODE_DISABLE_COLORS = true;
process.stderr.columns = 20;

// Confirm that there is no position indicator.
assert.throws(
  () => { assert.deepStrictEqual('a'.repeat(30), 'a'.repeat(31)); },
  (err) => !err.message.includes('^')
);

// Confirm that there is a position indicator.
assert.throws(
  () => { assert.deepStrictEqual('aaa', 'aaaa'); },
  (err) => err.message.includes('^')
);
<commit_msg>Setup stderr params to check position indicator<commit_after>// Currently in sync with Node.js test/pseudo-tty/test-assert-position-indicator.js
// https://github.com/nodejs/node/commit/40a8a7391664e7a5d8a264a1d85d059f9c05063b

'use strict';
require('../common');
const assert = require('../../assert');

process.env.NODE_DISABLE_COLORS = true;
if (!process.stderr) {
  process.stderr = {};
}
process.stderr.isTTY = true;
process.stderr.columns = 20;

// Confirm that there is no position indicator.
assert.throws(
  () => { assert.deepStrictEqual('a'.repeat(30), 'a'.repeat(31)); },
  (err) => !err.message.includes('^')
);

// Confirm that there is a position indicator.
assert.throws(
  () => { assert.deepStrictEqual('aaa', 'aaaa'); },
  (err) => err.message.includes('^')
);

{'fraction_non_alphanumeric': 0.18840579710144928, 'fraction_numerical': 0.04692891649413389, 'mean_word_length': 4.513307984790875, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 2, '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': '5994340', 'n_tokens_mistral': 536, 'n_tokens_neox': 503, 'n_words': 95}