Added test package in nix flake to automatically run tests.
To be able to do such, it was required to add the vendor directory to the git project.
This commit is contained in:
1 parent
459dc26b4f
commit
1f2ea8b7e5
15 files changed
+2619
No files matched your search
+23
@@ -0,0 +1,23 @@
|
||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||
// This module is browser compatible.
|
||||
|
||||
/**
|
||||
* Converts the input into a string. Objects, Sets and Maps are sorted so as to
|
||||
* make tests less flaky
|
||||
* @param v Value to be formatted
|
||||
*/
|
||||
export function format(v: unknown): string {
|
||||
// deno-lint-ignore no-explicit-any
|
||||
const { Deno } = globalThis as any;
|
||||
return typeof Deno?.inspect === "function"
|
||||
? Deno.inspect(v, {
|
||||
depth: Infinity,
|
||||
sorted: true,
|
||||
trailingComma: true,
|
||||
compact: false,
|
||||
iterableLimit: Infinity,
|
||||
// getters should be true in assertEquals.
|
||||
getters: true,
|
||||
})
|
||||
: `"${String(v).replace(/(?=["\\])/g, "\\")}"`;
|
||||
}
|
||||
Reference in new issue
Block a user