Skip to content

Commit

Permalink
feat: add std/expect (#3814)
Browse files Browse the repository at this point in the history
Co-authored-by: Thomas Cruveilher <38007824+Sorikairox@users.noreply.github.com>
  • Loading branch information
kt3k and Sorikairox committed Nov 21, 2023
1 parent 8e52ea8 commit 1a7ede0
Show file tree
Hide file tree
Showing 40 changed files with 2,197 additions and 0 deletions.
13 changes: 13 additions & 0 deletions expect/_inspect_args.ts
@@ -0,0 +1,13 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
// deno-lint-ignore-file

export function inspectArgs(args: unknown[]): string {
return args.map(inspectArg).join(", ");
}

export function inspectArg(arg: unknown): string {
const { Deno } = globalThis as any;
return typeof Deno !== "undefined" && Deno.inspect
? Deno.inspect(arg)
: String(arg);
}

0 comments on commit 1a7ede0

Please sign in to comment.