summaryrefslogtreecommitdiff
path: root/test/pseudo-tty/test-assert-position-indicator.js
blob: 26f82b5b13fb1b69fa6ae08595fbcf435e7a5daa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
'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('^')
);