mirror of
https://github.com/nodejs/node.git
synced 2026-11-30 11:55:44 -05:00
This test adds coverage for a ternary in assertion_error.js that checks if stderr is a TTY. PR-URL: https://github.com/nodejs/node/pull/26024 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
19 lines
469 B
JavaScript
19 lines
469 B
JavaScript
'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('^')
|
|
);
|