filecoin-station / zinnia

Runtime for worker nodes executing modules in a resource-limited sandbox
https://crates.io/crates/zinnia
Other
17 stars 2 forks source link

fix: object diff when assertion failed #562

Closed bajtos closed 1 month ago

bajtos commented 1 month ago

Expose Deno.inspect as Zinnia.inspect.

Fix the error message printed by assertion functions to describe object properties.

Before this fix:

error: Uncaught AssertionError: Values are not equal.

    [Diff] Actual / Expected

    "[object Object]"

    at assertEquals (ext:zinnia_runtime/vendored/asserts.bundle.js:479:11)

After the fix:

error: Uncaught AssertionError: Values are not equal.

    [Diff] Actual / Expected

    {
-     foo: "bar",
+     foo: "123",
    }

    at assertEquals (ext:zinnia_runtime/vendored/asserts.bundle.js:495:11)

I noticed the problem while working on https://github.com/filecoin-station/spark/issues/46