mirror of
https://github.com/nodejs/node.git
synced 2024-11-29 23:16:30 +01:00
0cd602879c
This makes sure that the error message is more appropriate than before by checking closer what operator is used and which is not. It also increases the total number of lines printed to the user. PR-URL: https://github.com/nodejs/node/pull/27525 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
19 lines
471 B
JavaScript
19 lines
471 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('aaaa', 'aaaaa'); },
|
|
(err) => err.message.includes('^')
|
|
);
|