function expose_assert(f, name) {
        function assert_wrapper(...args) {
            let status = Test.statuses.TIMEOUT;
            let stack = null;
            let new_assert_index = null;
            try {
                if (settings.debug) {
                    console.debug("ASSERT", name, tests.current_test && tests.current_test.name, args);
                }
                if (tests.output) {
                    tests.set_assert(name, args);
                    // Remember the newly pushed assert's index, because `apply`
                    // below might push new asserts.
                    new_assert_index = tests.asserts_run.length - 1;
                }
                const rv = f.apply(undefined, args);
                status = Test.statuses.PASS;
                return rv;
            } catch(e) {
                status = Test.statuses.FAIL;
                stack = e.stack ? e.stack : null;
                throw e;
            } finally {
                if (tests.output && !stack) {
                    stack = get_stack();
                }
                if (tests.output) {
                    tests.set_assert_status(new_assert_index, status, stack);
                }
            }
        }
        expose(assert_wrapper, name);
    }
Convert a value to a nice, human-readable string

When many JavaScript Object values are coerced to a String, the
resulting value will be ``"[object Object]"``. This obscures
helpful information, making the coerced value unsuitable for
use in assertion messages, test names, and debugging
statements. `format_value` produces more distinctive string
representations of many kinds of objects, including arrays and
the more important DOM Node types. It also translates String
values containing control characters to include human-readable
representations.

@example
// "Document node with 2 children"
format_value(document);
@example
// "\"foo\\uffffbar\""
format_value("foo\uffffbar");
@example
// "[-0, Infinity]"
format_value([-0, Infinity]);
@param {Any} val - The value to convert to a string.
@returns {string} - A string representation of ``val``, optimised for human readability.