Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ext/console): bump default max str lengthto 10_000 #24245

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ext/console/01_console.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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";
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/console_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down