0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 23:43:09 +01:00
nodejs/test/pseudo-tty/test-assert-position-indicator.js

19 lines
471 B
JavaScript
Raw Normal View History

'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('aaaa', 'aaaaa'); },
(err) => err.message.includes('^')
);