diff options
author | Kevin (Kun) "Kassimo" Qian <kevinkassimo@gmail.com> | 2018-12-19 22:08:49 -0500 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-12-19 22:08:49 -0500 |
commit | 419000d5568560b9e625ae8229b31cc90beca4ee (patch) | |
tree | 72dc1ef79c438d60491fb39d9f82f205590cb8dd /js/console_test.ts | |
parent | 1cd18a9ac678e7863404a1ec598391937060e390 (diff) |
Expose deno.inspect (#1378)
Diffstat (limited to 'js/console_test.ts')
-rw-r--r-- | js/console_test.ts | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/js/console_test.ts b/js/console_test.ts index 2946d3648..b0fb9b5c4 100644 --- a/js/console_test.ts +++ b/js/console_test.ts @@ -1,6 +1,6 @@ // Copyright 2018 the Deno authors. All rights reserved. MIT license. import { test, assert, assertEqual } from "./test_util.ts"; -import { stringifyArgs } from "./console.ts"; +import { stringifyArgs, inspect } from "./console.ts"; import { Console } from "./console.ts"; import { libdeno } from "./libdeno"; @@ -120,6 +120,8 @@ test(function consoleTestStringifyCircular() { // tslint:disable-next-line:max-line-length "Console { printFunc: [Function], log: [Function], debug: [Function], info: [Function], dir: [Function], warn: [Function], error: [Function], assert: [Function], count: [Function], countReset: [Function], time: [Function], timeLog: [Function], timeEnd: [Function] }" ); + // test inspect is working the same + assertEqual(inspect(nestedObj), nestedObjExpected); }); test(function consoleTestStringifyWithDepth() { @@ -138,6 +140,11 @@ test(function consoleTestStringifyWithDepth() { stringifyArgs([nestedObj], { depth: null }), "{ a: { b: { c: { d: [Object] } } } }" ); + // test inspect is working the same way + assertEqual( + inspect(nestedObj, { depth: 4 }), + "{ a: { b: { c: { d: [Object] } } } }" + ); }); test(function consoleTestCallToStringOnLabel() { |