summaryrefslogtreecommitdiff
path: root/cli/tests/unit/console_test.ts
AgeCommit message (Collapse)Author
2024-02-10chore: move cli/tests/ -> tests/ (#22369)Matt Mastracci
This looks like a massive PR, but it's only a move from cli/tests -> tests, and updates of relative paths for files. This is the first step towards aggregate all of the integration test files under tests/, which will lead to a set of integration tests that can run without the CLI binary being built. While we could leave these tests under `cli`, it would require us to keep a more complex directory structure for the various test runners. In addition, we have a lot of complexity to ignore various test files in the `cli` project itself (cargo publish exclusion rules, autotests = false, etc). And finally, the `tests/` folder will eventually house the `test_ffi`, `test_napi` and other testing code, reducing the size of the root repo directory. For easier review, the extremely large and noisy "move" is in the first commit (with no changes -- just a move), while the remainder of the changes to actual files is in the second commit.
2024-02-07chore(cli): Use @test_util for relative path for unit tests (#22327)Matt Mastracci
This removes the majority of `../../../../../../test_util` relative imports from the codebase, allowing us to move this code more easily in the future.
2024-01-14chore: upgrade deno_core to 0.246.0 (#21904)Bartek Iwańczuk
2024-01-04fix: strict type check for cross realms (#21669)Kenta Moriuchi
Deno v1.39 introduces `vm.runInNewContext`. This may cause problems when using `Object.prototype.isPrototypeOf` to check built-in types. ```js import vm from "node:vm"; const err = new Error(); const crossErr = vm.runInNewContext(`new Error()`); console.assert( !(crossErr instanceof Error) ); console.assert( Object.getPrototypeOf(err) !== Object.getPrototypeOf(crossErr) ); ``` This PR changes to check using internal slots solves them. --- current: ``` > import vm from "node:vm"; undefined > vm.runInNewContext(`new Error("message")`) Error {} > vm.runInNewContext(`new Date("2018-12-10T02:26:59.002Z")`) Date {} ``` this PR: ``` > import vm from "node:vm"; undefined > vm.runInNewContext(`new Error("message")`) Error: message at <anonymous>:1:1 > vm.runInNewContext(`new Date("2018-12-10T02:26:59.002Z")`) 2018-12-10T02:26:59.002Z ``` --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-01-01chore: update copyright to 2024 (#21753)David Sherret
2023-12-19fix(console): inspect for `{Set,Map}Iterator` and `Weak{Set,Map}` (#21554)Kenta Moriuchi
2023-11-01feat: enable Array.fromAsync (#21048)Bartek Iwańczuk
2023-09-19fix(cli): ensure that an exception in ↵Matt Mastracci
getOwnPropertyDescriptor('constructor') doesn't break Deno.inspect (#20568) Fixes #20561
2023-06-28fix(console): correct the parseCssColor algorithm (#19645)Nicholas Berlette
This is a fix for issue #19644, concerning the `parseCssColor` function in the file `ext/console/01_console.js`. Changes made on lines 2756-2758. To sum it up: > The internal `parseCssColor` function currently parses 3/4-digit hex colors incorrectly. For example, it parses the string `#FFFFFF` as `[255, 255, 255]` (as expected), but returns `[240, 240, 240]` for `#FFF`, when it should return the same triplet as the former. While it's not going to cause a fatal runtime error, it did bug me enough to fix it real quick.
2023-06-26chore: fix typos (#19572)Martin Fischer
2023-06-06fix(ext/console): fix inspecting large ArrayBuffers (#19373)ud2
2023-06-05feat: add more options to Deno.inspect (#19337)Leo Kettmeir
For https://github.com/denoland/deno_std/issues/3404 --------- Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2023-05-11fix(console): handle error when inspecting promise-like (#19083)Nayeem Rahman
Fixes https://discord.com/channels/684898665143206084/684911491035430919/1105900195406958672. This was caused by: - A `TypeError` from `core.getPromiseDetails()` for promise-likes which also lead to that code path. - Swallowing internal formatting errors by returning `undefined`. I've made it so that a special message is formatted in that case instead (note that this case is fixed now): ![image](https://github.com/denoland/deno/assets/29990554/65bb9612-60b2-4e31-bf5e-e20976601593)
2023-04-30refactor: merge Deno & Node inspectors (#18691)Leo Kettmeir
2023-03-21chore(ext/console): inspect anonymous function as `[Function (anonymous)]` ↵Yoshiya Hinosawa
(#18283) This PR changes the inspect result of anonymous functions from `[Function]` to `[Function (anonymous)]`. This behavior is aligned to `util.inspect` of Node.js.
2023-03-17chore(ext/console): add 'quotes' internal option to Deno.inspect (#18183)Yoshiya Hinosawa
2023-03-01fix(core): introduce `SafeRegExp` to primordials (#17592)Kenta Moriuchi
2023-02-08fix(ext/console): Only right-align integers in console.table() (#17389)Waldir Pimenta
2023-02-05fix(ext/console): log class for class constructor (#17615)Gasman
Co-authored-by: tannal <tannal.cn@gmail.com>
2023-01-02chore: update copyright year to 2023 (#17247)David Sherret
Yearly tradition of creating extra noise in git.
2022-11-22fix(inspector): ensure console methods provided by inspector are available ↵Bartek Iwańczuk
(#16724)
2022-10-10fix sparse array inspection (#16204)sigmaSd
fix https://github.com/denoland/deno/issues/16202
2022-09-26fix(ext/console): fix error when logging a proxied Date (#16018)李瑞丰
2022-09-26perf(ext/console): break on iterableLimit & better sparse array handling ↵Marcos Casagrande
(#15935)
2022-09-20feat(cli): update to TypeScript 4.8 (#15064)Kitson Kelly
2022-09-02fix(cli/repl): await Promise.any([])... (#15623)Jason
2022-06-15fix(console): constrol inspect() indent with option (#14867)cjihrig
This commit updates the Deno.inspect() logic to use the indentLevel option to control indentation instead of passing around separate indent/level parameters internally. Refs: https://github.com/denoland/deno/issues/8099 Refs: https://github.com/denoland/deno/issues/14171
2022-06-13feat(console): pass options and depth to custom inspects (#14855)Colin Ihrig
This commit updates Deno.inspect() to pass inspect options and the current inspect depth to custom inspect functions. Refs: https://github.com/denoland/deno/issues/8099 Refs: https://github.com/denoland/deno/issues/14171
2022-05-25chore: upgrade test_util/std/ submodule (#14722)Bartek Iwańczuk
2022-04-26feat(ext/console): Compact empty iterables when calling Deno.inspect with ↵Ben Heidemann
compact false (#14387)
2022-04-25feat(ext/console): Add string abbreviation size option for "Deno.inspect" ↵Ben Heidemann
(#14384)
2022-03-20fix(ext/console): fix error with a Proxy of a Map (#14032)Jason
2022-03-02feat(cli): update to TypeScript 4.6.2 (#13474)Kitson Kelly
2022-02-06fix(ext/console): fix uncaught TypeError in css styling (#13567)Zach
When using css coloring in the console, non-color values should be ignored rather than throw exceptions. Fixes #13469
2022-02-04feat(ext/console): better circular information in object inspection (#13555)Leo Kettmeir
2022-01-20chore: update copyright year (#13434)Yoshiya Hinosawa
2021-12-23fix(ext/console): map basic css color keywords to ansi (#13175)Zach
2021-11-23refactor: remove "unitTest" wrapper from cli/tests/unit (#12750)Bartek Iwańczuk
2021-10-30feat(ext/console): Display error.cause in console (#12462)Kenta Moriuchi
2021-10-14fix(console): fix display of primitive wrapper objects (#12425)Kenta Moriuchi
2021-09-04refactor(testing): redirect console output via reporter (#11911)Casper Beyer
This feeds console output to the reporter and handles silencing there instead of in the JavaScript code.
2021-08-24feat(extensions/console): right align numeric columns in table (#11748)Nicolas Stucki
2021-08-05refactor(cli/tests): remove unnecessary void return types (#11577)Leo K
2021-07-07fix(extensions/console): left align table entries (#11295)Divy Srivastava
2021-07-05chore: upgrade crates (#11284)Bartek Iwańczuk
2021-06-27feat(inspector): pipe console messages between terminal and inspector (#11134)Bartek Iwańczuk
This commit adds support for piping console messages to inspector. This is done by "wrapping" Deno's console implementation with default console provided by V8 by the means of "Deno.core.callConsole" binding. Effectively each call to "console.*" methods calls a method on Deno's console and V8's console.
2021-06-25chore(ext/console): deprecate Deno.customInspect (#10035)Yoshiya Hinosawa
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2021-06-15fix(inspector): Deno.inspect should inspect the object the proxy represents ↵David Sherret
rather than the target of the proxy (#10977)
2021-04-27fix(console): circular customInspect (#10338)Aaron O'Mullan
2021-04-11fix(op_crates/console): console.table value misalignment with varying keys ↵Liam Murphy
(#10127)