diff options
author | Kitson Kelly <me@kitsonkelly.com> | 2020-09-25 21:36:26 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-25 21:36:26 +1000 |
commit | fd1c913985df2f835612e79c3bd2d6312b57a04b (patch) | |
tree | d0941039567f813de8a9ebe9741a507e7eee410c /cli/tests/unit/console_test.ts | |
parent | 01147fab80cdcc837c160e5d21ed8276839777ef (diff) |
fix(cli): customInspect works on functions (#7670)
Fixes #7650
Diffstat (limited to 'cli/tests/unit/console_test.ts')
-rw-r--r-- | cli/tests/unit/console_test.ts | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/cli/tests/unit/console_test.ts b/cli/tests/unit/console_test.ts index 38bb852f0..eb2c51aef 100644 --- a/cli/tests/unit/console_test.ts +++ b/cli/tests/unit/console_test.ts @@ -831,6 +831,17 @@ unitTest(function consoleTestWithCustomInspectorError(): void { ); }); +unitTest(function consoleTestWithCustomInspectFunction(): void { + function a() {} + Object.assign(a, { + [customInspect]() { + return "b"; + }, + }); + + assertEquals(stringify(a), "b"); +}); + unitTest(function consoleTestWithIntegerFormatSpecifier(): void { assertEquals(stringify("%i"), "%i"); assertEquals(stringify("%i", 42.0), "42"); |