diff options
author | Khải <hvksmr1996@gmail.com> | 2020-04-05 00:13:37 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-04 13:13:37 -0400 |
commit | 788a6abfd391b8899d28552a9f192d9aaee91347 (patch) | |
tree | af6895f8c1bd06b9dcd6336986bbbf78d23e378b /std/testing/format.ts | |
parent | faa0f520cf3ad03eef51d9a236202e181fe4ea69 (diff) |
fix(std/testing): formatting bigint (#4626)
Diffstat (limited to 'std/testing/format.ts')
-rw-r--r-- | std/testing/format.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/std/testing/format.ts b/std/testing/format.ts index ee291dc23..4004ebc9d 100644 --- a/std/testing/format.ts +++ b/std/testing/format.ts @@ -115,6 +115,10 @@ function printSymbol(val: symbol): string { return symbolToString.call(val).replace(SYMBOL_REGEXP, "Symbol($1)"); } +function printBigInt(val: bigint): string { + return val.toString() + "n"; +} + function printError(val: Error): string { return "[" + errorToString.call(val) + "]"; } @@ -155,6 +159,9 @@ function printBasicValue( if (typeOf === "symbol") { return printSymbol(val); } + if (typeOf === "bigint") { + return printBigInt(val); + } const toStringed = toString.call(val); |