mirror of
https://github.com/denoland/deno.git
synced 2024-11-25 15:29:32 -05:00
fix(ext/console): bump default max str lengthto 10_00 (#24245)
This commit is contained in:
parent
10ac3bb091
commit
7b5c514763
2 changed files with 4 additions and 4 deletions
|
@ -2329,7 +2329,7 @@ const denoInspectDefaultOptions = {
|
|||
|
||||
// node only
|
||||
maxArrayLength: 100,
|
||||
maxStringLength: 100, // deno: strAbbreviateSize: 100
|
||||
maxStringLength: 10_000, // deno: strAbbreviateSize: 10_000
|
||||
customInspect: true,
|
||||
|
||||
// deno only
|
||||
|
@ -2357,7 +2357,7 @@ function getDefaultInspectOptions() {
|
|||
|
||||
const DEFAULT_INDENT = " "; // Default indent string
|
||||
|
||||
const STR_ABBREVIATE_SIZE = 100;
|
||||
const STR_ABBREVIATE_SIZE = 10_000;
|
||||
|
||||
class CSI {
|
||||
static kClear = "\x1b[1;1H";
|
||||
|
|
|
@ -174,11 +174,11 @@ Deno.test(function consoleTestStringifyQuotes() {
|
|||
});
|
||||
|
||||
Deno.test(function consoleTestStringifyLongStrings() {
|
||||
const veryLongString = "a".repeat(200);
|
||||
const veryLongString = "a".repeat(10_100);
|
||||
// If we stringify an object containing the long string, it gets abbreviated.
|
||||
let actual = stringify({ veryLongString });
|
||||
assert(actual.includes("..."));
|
||||
assert(actual.length < 200);
|
||||
assert(actual.length < 10_100);
|
||||
// However if we stringify the string itself, we get it exactly.
|
||||
actual = stringify(veryLongString);
|
||||
assertEquals(actual, veryLongString);
|
||||
|
|
Loading…
Reference in a new issue