diff --git a/lib/internal/console/constructor.js b/lib/internal/console/constructor.js index 9c262aef62be25..e3de39f8126b7c 100644 --- a/lib/internal/console/constructor.js +++ b/lib/internal/console/constructor.js @@ -412,6 +412,7 @@ const consoleMethods = { const opt = { depth, maxArrayLength: 3, + breakLength: Infinity, ...this[kGetInspectOptions](this._stdout) }; return inspect(v, opt); diff --git a/test/parallel/test-console-table.js b/test/parallel/test-console-table.js index 3a4d6fefbbc8f1..35bd948f11afb0 100644 --- a/test/parallel/test-console-table.js +++ b/test/parallel/test-console-table.js @@ -244,3 +244,17 @@ test([{ a: 1, b: 'Y' }, { a: 'Z', b: 2 }], ` │ 1 │ 'Z' │ 2 │ └─────────┴─────┴─────┘ `); + +{ + const line = '─'.repeat(79); + const header = `${' '.repeat(37)}name${' '.repeat(40)}`; + const name = 'very long long long long long long long long long long long ' + + 'long long long long'; + test([{ name }], ` +┌─────────┬──${line}──┐ +│ (index) │ ${header}│ +├─────────┼──${line}──┤ +│ 0 │ '${name}' │ +└─────────┴──${line}──┘ +`); +}